Professional Documents
Culture Documents
File-System Structure
File-System Structure
Directory Implementation
Allocation Methods File system resides on secondary storage (disks).
Free-Space Management File system organized into layers.
Efficiency and Performance File control block – storage structure consisting of
information about a file.
Translates logical blocks into physical this OFT table and returns an index
Knows location of file, file allocation type to the raw in the table
directly controls disk hardware) to read and write physical symbolic file name
blocks on the disk,
IO control
The lowest level in the file system containing info about a file for the OS
Consists of device drivers and interrupt handlers to transfer FCB (is an index into a row in OFT) Directory info generally is copied into
111” into hardware specific ISA used by hardware controller. with the PCB)
This is accomplished by writing specific bits into IO registers
1
Directory Implementation Allocation Methods
Has a large effect on the file system performance Many files are stored on the same disk;
A) Linear list of file names with pointer to the data blocks.
2) Linked allocation
Major difficulty is its fixed size and dependence of hash function on disk blocks (similar to page table)
Random access.
Many newer file systems (e.g. Veritas File System) use a Each file is a linked list of disk blocks: blocks may be
modified contiguous allocation scheme. scattered anywhere on the disk.
block = pointer
2
Linked Allocation (Cont.) Linked Allocation
File-allocation table (FAT) – Linked allocation solves external fragmentation but cannot
support direct access (FAT helps in that)
disk-space allocation used by
Indexed allocation solves the direct access problem by
MS-DOS and OS/2. FAT table
Bringing all pointers together into the index block.
To read the k-th block we first find its address in the index block by
looking the k-th pointer
Logical view.
index table
outer-index
3
Combined Scheme: UNIX inode (4K bytes per
Free-Space Management
block)
Space represented with Bit vector (n blocks)
0 1 2 n-1
…
0 block[i] free
bit[i] =
1 block[i] occupied
Bit map
Solution:
Allocate block[i]
Performance
Disk/buffer cache – separate section of main memory for
4
Various Disk-Caching Locations Page Cache
Routine I/O through the file system uses the buffer (disk)
cache.