东南大学《操作系统》课程作业 第十章

1. Consider a file system in which a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided?
如果在文件删除并且磁盘空间释放后,链接仍然存在,则当一个新文件创建在该位置时,将导致通过该链接、期望访问旧文件的用户,访问到新文件。同时,通过该链接的访问权限控制仍然是旧文件拥有的权限设置,这可能导致对新文件的非法访问。
为避免这个问题,可以要求文件删除并且磁盘空间释放后,立即删除所有相关的链接。如果系统内维护了文件-链接的映射表,还可以要求当且仅当该文件的链接已经全部删除时,才可以删除文件。

2. If the operating system knew that a certain application was going to access file data in a sequential manner, how could it exploit this information to improve performance?
如果系统知道应用将要顺序访问文件数据,则可以提前预调当前文件块后续的文件块。这样,应用后续等待文件块调入的时间就可以减少了。

3. Some systems provide file sharing by maintaining a single copy of a file. Other systems maintain several copies, one for each of the users sharing the file. Discuss the relative merits of each approach.
如果共享的文件只有一份副本,可以节约存储空间,但是系统需要仔细地处理并发写入的问题,避免文件内容出现不一致。
如果共享的文件有多份副本,则需要更多的存储空间,并且每个文件之间难以保持一致性,但是不需要考虑并发问题。

原文地址:https://www.cnblogs.com/zxuuu/p/15631305.html