4.4 Linux File System
4.4 Linux File System
Session 4.4
Shripad V Deshpande
Buffer Cache
Direct blocks
Indirect blocks
File info
Double
Indirect
Blocks
Directories
• These are structured in a tree hierarchy
• Each can contain both files and directories
• A directory is just a particular type of file
• Special user-functions for directory access
• Each dentry contains filename + inode-no
• Kernel searches the directory tree, and
translates a pathname to an inode-number
Directory to iNode linking
i2 name2
i3 name3
i4 name4
Links
• Multiple names can point to same inode
• The inode keeps track of how many links
• If a file gets deleted, the inode’s link-count
gets decremented by the kernel
• File is deallocated if link-count reaches 0
• This type of linkage is called a ‘hard’ link
• Hard links may exist only within a single FS
• Hard links cannot point to directories (cycles)
Symbolic Links
• Another type of file linkage (‘soft’ links)
• Special file, consisting of just a filename
• Kernel uses name-substitution in search
• Soft links allow cross-filesystem linkage
• But they do consume more disk storage
Next Session 4.5 ->
Processes and Threads Concept