Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Chapter 4 1

616 views

Published on

Published in: Technology, Business
  • Be the first to like this

Chapter 4 1

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6. Create a directory tree <br />See page 108, 109, 110<br />
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11. Operations of Adding a New File<br />Store Properties<br />Locate a free inodeas 47<br />Record the file information in the inode<br />Store Data<br />Locate disk blocks for file content such as 627, 200, and 992.<br />Record Allocation<br />Record the sequence of block numbers in the disk allocation section of the inode<br />Add Filename to Directory<br />Add the new entry (47, userlist) to the directory.<br />
  12. 12. Looking inside a directory<br />Directory is a special kind of file that contains a list of names of files.<br />Ls – 1ia demodir //i for inode number<br />Ls –ia / //root and parent of root //point to itself<br />
  13. 13. The file system in practice<br />What will happen when you type:<br />> cat userlist<br />The kernel searches the directory for the filename: userlist, inode number 47 found<br />Locate the real inode 47 in inode table. The inode contains a list of data block numbers.<br />Go to the data block one by one to read the data with read system call.<br />The permission is also checked from inode<br />
  14. 14.
  15. 15. STRUCTURE OF A REGULAR FILE<br />The blocks marked "direct”<br />contain the numbers of disk blocks that contain real data.<br />The block marked "single indirect" <br />refers to a block that contains a list of direct block numbers.<br />To access the data via the indirect block, the kernel must read the indirect block, find the appropriate direct block entry, and then read the direct block to find the data.<br />
  16. 16. STRUCTURE OF A REGULAR FILE<br />The block marked "double indirect" contains a list of indirect block numbers, and <br />the block marked "triple indirect" contains a list of "double indirect " block numbers refers to a block that contains a list of direct block numbers.<br />Assume <br />that a logical block = I K bytes<br />A block number is addressable by a 32 bit (4 byte) integer.<br />Then a block can hold up to 256 block numbers.<br />
  17. 17. A single indirect data block can hold 256 block numbers (1024 bytes/4 bytes)<br />

×