CS137 Homework 3: FAT, part 2

Overview

The purpose of this assignment is to finish the filesystem you begain in Homework 2. At the end of this assignment, you should have a working filesystem that can be used to store actual files.

You may write in any language that is supported on Wilkes, but as mentioned in class, I strongly recommend C or C++.

The Assignment

Your assignment is to finish the FAT-like filesystem that you began in Homework 2. Your finished filesystem should have the following features:

  1. The general structure of the filesystem is similar to the Microsoft FAT design (see below).
  2. In addition to the calls supported in Homework 2 (getattr, access, readdir, and mkdir, you must support the following additional operations: close (i.e., release), create, fgetattr, mknod (only for plain files), open, read, readlink, rmdir, statfs, symlink, truncate, unlink, and write.
  3. You are not required to support chmod, chown, fsync, link, rename, or utimens. Note that many of these operations require additional filesystem design (e.g., chown requires that you track ownership).
  4. Your write operation must support full Unix semantics: it must be possible to extend a file by writing at the end, to rewrite arbitrary bytes in the middle of a file, and to extend a file by a large amount by seeking far past the end and writing a single byte.
  5. You are not required to support sparse files (FAT-like file systems don't get along well with sparse files.
  6. Directories should be variable-sized and should grow as files are created within them. However, it is not necessary to shrink directories when files are removed.
  7. The statfs operation should correctly report the amount of free space in the file system. In particular, if it says that n blocks are left, it should be possible to write exactly n more blocks of data to an existing file.
  8. Note that your path-evaluation code doesn't need to do anything special for symbolic links; FUSE will do that for you.

Testing

Many of your features can be tested using standard Unix utilities (dd--see man dd--is especially useful). However, you may wish to write special test code or scripts.

Submission

Submit your code (it should be a single file) as assignment 3 with cs137submit. If you implement any extra features, please describe them prominently in comments at the top of the file.


© 2014, Geoff Kuenning

This page is maintained by Geoff Kuenning.