VI 2 File Syst Impl
VI 2 File Syst Impl
VI 2 File Syst Impl
12.1
File-System Structure
File structure
Logical storage unit
Collection of related information
File system resides on secondary storage (disks).
File system organized into layers.
File control block storage structure consisting of
12.2
12.3
12.4
12.5
12.6
12.7
12.8
Directory Implementation
Linear list of file names with pointer to the data blocks.
simple to program
time-consuming to execute
Hash Table linear list with hash data structure.
decreases directory search time
collisions situations where two file names hash to the
same location
fixed size
12.9
Allocation Methods
An allocation method refers to how disk blocks are
Contiguous allocation
Linked allocation
Indexed allocation
12.10
Contiguous Allocation
Random access.
Wasteful of space (dynamic storage-allocation problem).
Files cannot grow.
12.11
12.12
Extent-Based Systems
Many newer file systems (I.e. Veritas File System) use a
12.13
Linked Allocation
Each file is a linked list of disk blocks: blocks may be
pointer
12.14
Q
R
Linked Allocation
12.16
File-Allocation Table
12.17
Indexed Allocation
Brings all pointers together into the index block.
Logical view.
index table
12.18
12.19
Q
R
12.20
LA / (512 x 511)
R1
Q2
R2
12.21
LA / (512 x 512)
R1
R2
12.22
outer-index
index table
12.23
file
12.24
Free-Space Management
Bit vector (n blocks)
0 1 2
n-1
bit[i] =
0 block[i] free
1 block[i] occupied
12.25
Grouping
Counting
12.26
Need to protect:
Pointer to free list
Bit map
Must be kept on disk
Copy in memory and disk may differ.
Cannot allow for block[i] to have a situation where bit[i] =
1 in memory and bit[i] = 0 on disk.
Solution:
Set bit[i] = 1 in disk.
Allocate block[i]
Set bit[i] = 1 in memory
12.27
12.28
12.29
12.30
Page Cache
A page cache caches pages rather than disk blocks
cache.
12.31
12.32
12.33
12.34
Recovery
Consistency checking compares data in directory
12.35
12.36
12.37
NFS (Cont.)
Interconnected workstations viewed as a set of
12.38
NFS (Cont.)
NFS is designed to operate in a heterogeneous
12.39
12.40
Mounting in NFS
Mounts
Cascading mounts
12.41
client.
Mount operation includes name of remote directory to be
mounted and name of server machine storing it.
12.42
NFS Protocol
Provides a set of remote procedure calls for remote file
NFS servers are stateless; each request has to provide a full set
of arguments.
Modified data must be committed to the servers disk before
results are returned to the client (lose advantages of caching).
The NFS protocol does not provide concurrency-control
mechanisms.
12.43
12.44
12.45
12.46
system calls and the NFS protocol RPCs (except opening and
closing files).
NFS adheres to the remote-service paradigm, but employs
buffering and caching techniques for the sake of performance.
File-blocks cache when a file is opened, the kernel checks
with the remote server whether to fetch or revalidate the cached
attributes. Cached file blocks are used only if the corresponding
cached attributes are up to date.
File-attribute cache the attribute cache is updated whenever
new attributes arrive from the server.
Clients do not free delayed-write blocks until the server confirms
that the data have been written to disk.
12.47