CSCI 333
Storage Systems
Home | Schedule | Labs | Williams CS | Piazza
Lab 2a: FUSE FAT, part I
Assigned | Thursday, 03/03 |
---|---|
Due Date | Friday 04/05 at 11pm |
Objectives
You have become (relatively) familiar with FUSE though your barebones "Hello FUSE" implementation of a minimal file system containing a single pseudo-file. Now we will extend our FS behavior to support the creation, deletion, and modification of files and directories. Through this lab, we will explore the challenges of managing persistent data in a file system.
.Overview
Developing a working file system is very hard. For that reason, this assignment is divided into two parts. In part I (this part), you will develop a lot of scaffolding and enough code for your filesystem to do something testable. In part II (the next part), you will complete the filesystem.
The Assignment
Your assignment is to develop a FAT-like filesystem that supports the following features by the end of part I:
getattr
, access
,
readdir
, and mkdir
. (Note that at
this point it is not necessary to support
file I/O, or even regular files.)
mkdir
operation must allocate space from
the free list.
#defined
constant (this way you can change it later).
Remember to watch out for the working-directory
gotcha.
SIGKILL
. O_DSYNC
isn't
necessary, because the operating system will make sure your
data gets to stable storage unless the entire OS crashes—which
isn't part of the testing plan!)
ls -la
returning reasonable results including "." and ".."), and
cd
into them.
rmdir
, etc. in the
next assignment, so you are welcome to implement those
things. However, they will not be tested in the current
assignment.
Why this particular set of features? It's the minimum necessary to have a filesystem where you can do something visible: create and list directories. You'll find that you need to create quite a bit of scaffolding to get that far (in particular, the code that creates an initialized FAT filesystem from scratch).
When I refer to a "FAT-like" filesystem, I mean the following:
For reference, my minimal implementation used a block size of 512 bytes, had six fields in the superblock (including a magic number), and had four fields in the directory entry. To make it easy to store the superblock in a filesystem block, I used the following union:
union { struct fat_superblock s; char pad[512]; } superblock;
(Note that the superblock should be only 512 bytes, even if you use a different block size for your filesystem. That design makes it possible to read the superblock without knowing the block size, which is a useful feature. If the filesystem uses blocks larger than 512 bytes, the remaining space in the larger "block" is simply wasted.)
I also found it useful to create a few macros to do things like seeking to a particular block, converting back and forth between byte offsets and block numbers, etc.
Note: You are supposed to be writing a real filesystem. The only differences from a true implementation of FAT should be:
In particular, this means not taking easy shortcuts. Like any filesystem, your implementation must satisfy the following criteria:
Submission
Submit your code (it should be inside a single file named fat.c
)
to your git repository. If you implement any additional features,
describe them prominently in your README.md
file so that you
receive credit.
I would like everyone to use a "new" feature when submitting part 2a: git tags. A "tag" is essentially a label for a specific commit. You can create a tag from the command line (git manual on tags), or directly through the github web interface by creating a "release".
When you have completed your Lab 2a, please do two things:
Since you will continue to work on code in the same repository for part 2b, the tag will make sure that I test and give feedback on the correct version of your lab.
This lab borrows heavily from an assignment created by Geoff Kuenning, with only slight modificatons.