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 Knuth or Wilkes and that supports Fuse, but as mentioned in class, I strongly recommend C or C++.
Your assignment is to finish the FAT-like filesystem that you began in Homework 2. 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.
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.
Some things that I expect to work:
ls -la
, including for symlinks and files of
various sizes, and including .
and ..
echo xxx >> foo
")
dd
with the conv=notrunc
switch is
one way to do this)
statfs
(The df
command uses that call)
The above is not an exhaustive list. Try to think of what I've (deliberately) omitted.
Refer back to the important notes in part 1 of this assignment to make sure you don't do anything silly. In addition:
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.
© 2016, Geoff Kuenning
This page is maintained by Geoff Kuenning.