Chapter 12 File System Implementation
Chapter 12 File System Implementation
IMPLEMENTATION
Chapter 12
CHAPTER OBJECTIVES
12.2 File-System
Implementation 12.7 Recovery
Directory
12.3 12.8 NFS
Implementation
Allocation Example: The WAFL
12.4 12.9
Methods File-System
Free-Space 12.1 Summar
12.5
Management 0 y
12.1
FILE-SYSTEM
STRUCTURE
▪ Disks -provide most of the
secondary storage on which file
systems are maintained.
-To improve I/O efficiency, I/O
transfers between memory and
disk are performed in units of
BLOCKS.
▪ 2 Characteristics of Disk
-Blocks ca be read, modified,
and written (in place)
-Blocks can be directly in any
order.
File Systems
⮚ Provide efficient and convenient access to
the disk by allowing data to be stored,
located, and retrieved easily.
⮚ File system design problems:
-defining how the file system should look to
the user.
-creating algorithms and data structures to
map the logical file system onto the
physical secondary-storage devices.
File System Layers:
FILE-SYSTEM
IMPLEMENTATION
Disk Structures
• A boot control block (per volume) can contain
information needed by the system to boot an
operating system from that volume. If the disk
does not contain an operating system, this block
can be empty. It is typically the first block of a
volume. In UFS, it is called the boot block. In
NTFS, it is the partition boot sector.
▪ (UNIX inodes are unique within only a single file system.) This
network-wide uniqueness is required for support of network file
systems. The kernel maintains one vnode structure for each
active node (file or directory).
12.3 DIRECTORY IMPLEMENTATION
▪ simple to program
▪ time-consuming to execute
Accessing Files:
-Sequential and direct file access are
efficient with contiguous allocation since
the next block is adjacent to the current
one.
LINKED
ALLOCATION
Linked Allocation Basics:
-Each file is stored as a linked list of disk
blocks, which can be scattered across the
disk.
-The directory contains pointers to the first
and last blocks of a file, and each block has a
pointer to the next block.
▪ How it Works:
-Each file has an index block containing pointers to all
the disk blocks that store the file’s data. The directory
entry points to the index block.
12.5
FREE-SPACE
MANAGEMENT
▪ To keep track of free disk space, the system maintains a
free-space list.
001111001111110001100000011100000 ...
Performance
-disk cache – separate section of main memory for frequently used
blocks
-free-behind and read-ahead – techniques to optimize sequential access
-improve PC performance by dedicating section of memory as virtual
disk, or RAM disk
BUFFER CACHE
⮚ Some systems maintain a separate section of main memory
⮚ Blocks are kept under the assumption that they will be used
again shortly.
PAGE CACHE
⮚ uses virtual memory techniques to cache file data as pages
rather than as file-system-oriented blocks.
▪ It operates in layers: lower levels handle physical storage, and upper levels
manage logical file names. Different file systems are unified through a Virtual
File System (VFS) layer, allowing consistent access.
▪ Network file systems (e.g., NFS) enable remote file access but face challenges
with consistency and performance. Reliability is enhanced through techniques
like log structures and RAID, while performance is boosted by caching and
specialized file systems like WAFL.
THANKYOU
FOR
LISTENING!