CSCI 333
Storage Systems
Home | Schedule | Labs | Williams CS | Piazza
Lab 2b: FUSE FAT, part II
Assigned | Monday, 04/01 |
---|---|
Due Date |
|
Objectives
In lab 2b, you will (1) finish the prototype FAT filesystem you began in lab 2a, and (2) add enough functionality to your prototype filesystem that it can be used to store actual data in mutable files.
The Assignment
Your assignment is to finish the FAT-like filesystem that you began in lab 2a. Your finished filesystem should have the following features:
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
.
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).
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.
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 n additional blocks of data to an existing
file, and impossible to write n+1 blocks.
Testing your File System
Many of your features can be tested using standard Unix utilities
(the dd
utility is especially
useful—see `man dd`
).
I strongly recommend that you write special test code or scripts.
As soon as you add functionality, create a unit test.
Then run all of your existing unit tests to verify your new "feature"
didn't break anything!
I recommend creating a separate folder of test scripts.
Here are some things that I expect to work, so you are encouraged to create at least tests for these features:
ls -la
, including for symlinks and files of
various sizes, and including .
and ..
`echo xxx >> foo`
)
truncate
to extend files by adding zeros
dd
with the conv=notrunc
switch is
one way to do this)
statfs
(hint: the df
command uses that call)
The above is not an exhaustive list. Try to think of what has been (deliberately) omitted.
Important Notes
Refer back to the important notes in lab 2a to make sure you don't do anything silly. In addition:
Submission
Commit 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.
So that I know that you have finished, please use the commit message
"lab 2b submission" when you commit your final version.
If you later realize that you were not done, you can continue
to make additional commits, but it should be clear from the output of
`git log`
which version of your code is your submission.
This lab borrows heavily from an assignment created by Geoff Kuenning, with only slight modificatons.