X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=doc%2Ffilesys.texi;h=33cf740a631b49397a5be8a08c5d81801aac5a3a;hb=e5077cee0a6acf9d5155d04f6ac7d3693616edbb;hp=090397c1e4e1fe10330befc771ab837e57ed903a;hpb=83fc2d89cf608ee9395b853c0628fc684c6f250e;p=pintos-anon diff --git a/doc/filesys.texi b/doc/filesys.texi index 090397c..33cf740 100644 --- a/doc/filesys.texi +++ b/doc/filesys.texi @@ -111,6 +111,19 @@ root directory file to expand beyond its current limit of ten files. Make sure that concurrent accesses to the inode remain properly synchronized. +The user is allowed to seek beyond the current end-of-file (EOF). The +seek itself does not extend the file. Writing at a position past EOF +extends the file to the position being written, and any gap between the +previous EOF and the start of the write must be filled with zeros. A +read past EOF returns zero bytes. + +Writing far beyond EOF can cause many blocks to be entirely zero. Some +file systems allocate and write real data blocks for these implicitly +zeroed blocks. Other file systems do not allocate these blocks at all +until they are explicitly written. The latter file systems are said to +support ``sparse files.'' You may adopt either allocation strategy in +your file system. + @node Problem 4-3 Subdirectories @section Problem 4-3: Subdirectories