【正文】
d. 198 1 0e. 98 52 0f. 0 100 0 What problems could occur if a system allowed a ?le system to bemounted simultaneously at more than one location?Answer:4344 Chapter 12 FileSystem ImplementationThere would be multiple paths to the same ?le, which could confuseusers or encourage mistakes (deleting a ?le with one path deletes the?le in all the other paths). Why must the bit map for ?le allocation be kept on mass storage, ratherthan in main memory?Answer:In case of system crash (memory failure) the freespace list would notbe lost as it would be if the bit map had been stored in main memory. Consider a system that supports the strategies of contiguous, linked,and indexed allocation. What criteria should be used in deciding whichstrategy is best utilized for a particular ?le?Answer:?Contiguous—if ?le is usually accessed sequentially, if ?le isrelatively small.?Linked—if ?le is large and usually accessed sequentially.? Indexed—if ?le is large and usually accessed randomly. One problem with contiguous allocation is that the user must preallocate enough space for each ?le. If the ?le grows to be larger than thespace allocated for it, special actions must be taken. One solution to thisproblem is to de?ne a ?le structure consisting of an initial contiguousarea (of a speci?ed size). If this area is ?lled, the operating systemautomatically de?nes an over?ow area that is linked to the initialcontiguous area. If the over?ow area is ?lled, another over?ow areais allocated. Compare this implementation of a ?le with the standardcontiguous and linked implementations.Answer:This method requires more overhead then the standard contiguousallocation. It requires less overheadthan the standard linked allocation. How do caches help improve performance? Why do systems not usemore or larger caches if they are so useful?Answer:Caches allow ponents of differing speeds to municate moreef?ciently by storing data from the slower device, temporarily, ina faster device (the cache). Caches are, almost by de?nition, moreexpensive than the device they are caching for, so increasing the numberor size of caches would increase system cost. Why is it advantageous for the user for an operating system todynamically allocate its internal tables? What are the penalties to theoperating system for doing so?Answer:Dynamic tables allow more ?exibility in system use growth — tablesare never exceeded, avoiding arti?cial use limits. Unfortunately, kernelstructures and code are more plicated, so there is more potentialfor bugs. The use of one resource can take away more system resources(by growing to acmodate the requests) than with static Exercises 45 Explain how the VFS layer allows an operating system to supportmultiple types of ?le systems easily.Answer:VFS introduces a layer of indirection in the ?le system implementation.In many ways, it is similar to objectoriented programming techniques.System calls can be made generically (independent of ?le system type).Each ?le system type provides its function calls and data structuresto the VFS layer. A system call is translated into the proper speci?cfunctions for the target ?le system at the VFS layer. The calling programhas no ?lesystemspeci?c code, and the upper levels of the system callstructures likewise are ?le systemindependent. The translation at theVFS layer turns these generic calls into ?lesystemspeci?c operations.