Exercises

   


8.1 What are the seven classes of operations handled by the hierarchical filesystem?

8.2 What is the purpose of the inode data structure?

8.3 How does the system select an inode for replacement when a new inode must be brought in from disk?

8.4 Why are directory entries not allowed to span chunks?

8.5 Describe the steps involved in looking up a pathname component.

8.6 Why are hard links not permitted to span filesystems?

8.7 Describe how the interpretation of a symbolic link containing an absolute pathname is different from that of a symbolic link containing a relative pathname.

8.8 Explain why unprivileged users are not permitted to make hard links to directories but are permitted to make symbolic links to directories.

8.9 How can hard links be used to gain access to files that could not be accessed if a symbolic link were used instead?

8.10 How does the system recognize loops caused by symbolic links? Suggest an alternative scheme for doing loop detection.

8.11 How do quotas differ from the file-size resource limits described in Section 3.8?

8.12 How does the kernel determine whether a file has an associated quota?

8.13 Draw a picture showing the effect of processing an exclusive-lock request by process 1 on bytes 7 to 10 to the lock list shown in Figure 8.15. Which of the overlap cases of Figure 8.14 apply to this example?

8.14 In the absence of soft updates, which three FFS operations must be done synchronously to ensure that the filesystem can always be recovered deterministically after a crash (barring unrecoverable hardware errors)?

8.15 What are the guarantees made by the fsync system call?

8.16 Name the three ordering constraints that must be maintained when a file is removed. Describe how soft updates maintains this ordering.

8.17 Give three uses for a filesystem snapshot.

8.18 Describe the eight steps needed to take a filesystem snapshot.

8.19 What are the three states that a block may have in a snapshot? Describe the actions taken by a snapshot for each of these states when a write occurs. Describe the actions taken by a snapshot for each of these states when a block is released.

8.20 What are the four classes of operations handled by the datastore filesystem?

8.21 Under what circumstances can a write request avoid reading a block from the disk?

8.22 What is the difference between a logical block and a physical block? Why is this distinction important?

8.23 Give two reasons why increasing the basic block size in the old filesystem from 512 bytes to 1024 bytes more than doubled the system's throughput.

8.24 How many blocks and fragments are allocated to a 31,200-byte file on a FFS with 4096-byte blocks and 1024-byte fragments? How many blocks and fragments are allocated to this file on a FFS with 4096-byte blocks and 512-byte fragments? Also, answer these two questions assuming that an inode had only 6 direct block pointers instead of 12.

8.25 Explain why the FFS maintains a 5 to 10 percent reserve of free space. What problems would arise if the free-space reserve were set to zero?

8.26 What is a quadratic hash? Describe for what it is used in the FFS, and why it is used for that purpose.

8.27 Why are the allocation policies for inodes different from those for data blocks?

8.28 Under what circumstances does block clustering provide benefits that cannot be obtained with a disk-track cache?

*8.29 Give an example where the file-locking implementation is unable to detect a potential deadlock.

*8.30 What problems would arise if files had to be allocated in a single contiguous piece of the disk? Consider the problems created by multiple processes, random access, and files with holes.

**8.31 Design a system that allows the security level of the system to be lowered while the system is still running in multiuser mode.

**8.32 Inodes could be allocated dynamically as part of a directory entry. Instead, the inode allocation region is reserved when the filesystem is created. Why is the latter approach used?


   
 


The Design and Implementation of the FreeBSD Operating System
The Design and Implementation of the FreeBSD Operating System
ISBN: 0201702452
EAN: 2147483647
Year: 2003
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net