Directory b 0 rain 32 hail 48 each directory entry

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: indirect block Unix Unix File Naming (Hard Links) directory A A Unix file may have multiple names. directory B 0 rain: 32 hail: 48 Each directory entry naming the file is called a hard link. Each inode contains a reference count showing how many hard links name it. link system call link (existing name, new name) create a new name for an existing file increment inode link count wind: 18 0 sleet: 48 inode link count = 2 inode 48 unlink system call (“remove”) unlink(name) destroy directory entry decrement inode link count if count = 0 and file is not in active use free blocks (recursively) and on-disk inode Unix Unix Symbolic (Soft) Links Unix files may also be named by symbolic (soft) links. • A soft link is a file containing a pathname of some other file. directory A directory B 0 rain: 32 wind: 18 0 hail: 48 sleet: sleet: 67 symlink system call symlink (existing name, new name) allocate a new file (inode) with type symlink initialize file contents with existing name create directory entry for new file with new name inode link count = 1 ../A/hail/0 inode 48 The target of the link may be removed at any time, leaving a dangling reference. inode 67 Useful Useful when files span different file systems: link does not work across file systems Project Project #3 Next Next Lecture Distributed Systems Read Chap. 4 MOS, LFS paper...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online