File System Implementation

842 views
705 views

Published on

Principles of Operating System

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
842
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

File System Implementation

  1. 1. Computers store data on disks using files, which are structuredin specific ways in order to allow for faster access, higherreliability, and to make better use out of the drives availablespace.The specific way in which files are stored on a disk is called afile system, and enables files to have names and attributes.It also allows them to be stored in a hierarchy of directories orfolders arranged in a directory tree.
  2. 2. Linear list of file names with pointer to the data blocks. Simple to program Time consuming- linear search for file names required,whenever a new file is created or an existing file is deleted.A sorted list allows binary search, thereby reducing timeconsumption, but this complicates creation and deletion processes.
  3. 3. To Overcome this problem, many operating systems implement asoftware cache to store the most recently used directoryinformation from the disk.Hash table - another data structure. linear list stores the directory entries, but a hash data structure isalso used. the hash table takes a value computed from the file name andreturns a pointer to the file name in the linear list. greatly decreases directory search time. insertion and deletion are easy.Collisions – situation in which two file names hash to the samelocation.
  4. 4. Chained overflow hash table –• each hash entry is a linked list instead of an individual value• collisions can be avoided by adding a new entry to the linked list.
  5. 5. An allocation method refers to how disk blocks are allocated for files.The main problem is to allocate space to files so that disk space is utilized effectively and files can be accessed quickly.
  6. 6. Three types :1. Contiguous allocation2. Linked allocation3. Indexed allocation Each file occupy a set of contiguous blocks on that disk. Assuming only one job is accessing the disk, accessingblock ‘k+1’ after block ‘k’ normally requires no headmovement. Thus the number of disk seeks required foraccessing contiguously allocated files is minimal. Contiguous allocation of a file is defined by the diskaddress and length of the first block
  7. 7.  The directory entry for each file indicates the address ofthe starting block and the length of the area allocated for thefile.  Easy Accessing – only starting location (block #) and length (number for blocks) are required.  Files cannot grow.

×