Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 22nd, 2012  |  syntax: None  |  size: 0.80 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. header is a fixed size metadata block
  2. sector is a fixed size data block
  3. extent is a variable size data block constructed from sectors
  4.  
  5.  
  6. header - 16 words
  7. sector 0 - block_size words
  8. sector 1 - block_size words
  9. sector 2 - block_size words
  10. ...
  11. sector N
  12.  
  13. ------------
  14.  
  15. sector:
  16. next_sector_index - 1 word
  17. data - block_size - 1 words
  18.  
  19. -----------
  20.  
  21. extent (only exists in memory, not stored literally on disk):
  22. #extents can be read to read a file as a continuous section like: (inode,(data|links))
  23. size - 2 words
  24. first_block - 1 word
  25.  
  26. -----------
  27.  
  28. Reading a file:
  29. start with path and root sector
  30. read inode from root sector (using extent)
  31. for for part of path:
  32.     find link, get new sector id
  33.     read sector, get new inode
  34. #now we have the sector+inode of the file we want
  35. create extent from inode, read extent to get file data