-/* Filesystem.
-
- For the purposes of the "user processes" and "virtual memory"
- assignments (projects 2 and 3), please treat all the code in
- the filesys directory as a black box. No changes should be
- needed. For those projects, a single lock external to the
- filesystem code suffices.
-
- The filesystem consists of a set of files. Each file has a
- header called an `index node' or `inode', represented by
- struct inode, that is stored by itself in a single sector (see
- inode.h). The header contains the file's length in bytes and
- an array that lists the sector numbers for the file's
- contents.
-
- Two files are special. The first special file is the free
- map, whose inode is always stored in sector 0
- (FREE_MAP_SECTOR). The free map stores a bitmap (see
- lib/bitmap.h) that contains one bit for each sector on the
- disk. Each bit that corresponds to a sector within a file is
- set to true, and the other bits, which are not part of any
- file, are set to false.
-
- The second special file is the root directory, whose inode is
- always stored in sector 1 (ROOT_DIR_SECTOR). The root
- directory file stores an array of `struct dir_entry' (see
- directory.h), each of which, if it is in use, associates a
- filename with the sector of the file's inode.
-
- The filesystem implemented here has the following limitations:
-
- - No synchronization. Concurrent accesses will interfere
- with one another, so external synchronization is needed.
-
- - File size is fixed at creation time. Because the root
- directory is represented as a file, the number of files
- that may be created is also limited.
-
- - File data is allocated as a single extent, so that
- external fragmentation can become a serious problem as a
- file system is used over time.
-
- - No subdirectories.
-
- - Filenames limited to 14 characters.
-
- - A system crash mid-operation may corrupt the disk in a way
- that cannot be repaired automatically. No `fsck' tool is
- provided in any case.
-
- However one important feature is included:
-
- - Unix-like semantics for filesys_remove() are implemented.
- That is, if a file is open when it is removed, its blocks
- are not deallocated and it may still be accessed by the
- threads that have it open until the last one closes it. */
-
-/* Sectors of system file inodes. */
-#define FREE_MAP_SECTOR 0 /* Free map file inode sector. */
-#define ROOT_DIR_SECTOR 1 /* Root directory file inode sector. */
-
-/* Root directory. */
-#define NUM_DIR_ENTRIES 10 /* Maximum number of directory entries. */
-
-/* The disk that contains the filesystem. */