Daniel Ramsbrock
2005-11-28 16:47:45 UTC
Here are the clarifications for which I still need answers. TA's, can
one of you respond? Thanks,
Daniel
1. Concurrency: Under 10.9: Issues, Dave Hovemeyer's Project 5
guidelines mention both concurrency and file sharing. We already know
that we don't have to worry about file sharing (more than one process
opening the same file). However, it is not quite clear whether we still
need to worry about concurrency. It seems not, since we are assuming
that only one process is accessing a file or directory at one time.
Additionally, VFS and the buffer cache have their own locking
mechanisms, so that should take care of our concurrency needs.
Basically, my question is: do we need to worry about locking anything,
either inside the Sys_ functions or the GOSFS_ functions?
2. Opening files: Do we create the file descriptor table entry in
Sys_Open or in GOSFS_Open? (same applies to Sys_OpenDirectory and
GOSFS_Open_Directory). It seems like we create it in Sys_Open since a
file needs an FD no matter from which filesystem it was opened.
Additionally, the semantics of the VFS Open() call suggest that we
should have an FD assigned (and therefore a File struct pointer ready)
before calling it. Where should the Malloc for that File struct occur?
It seems like it needs to happen inside our GOSFS_Open/OpenDirectory
function.
3. Opening directories: Is there any fundamental difference between
Sys_Open and Sys_OpenDirectory? It seems like you can use basically the
same code for both, with the exception of the mode parameter and the
different names for the VFS functions which it needs to call. Are there
any other things which distinguish them?
4. Creating directories: When we create a new directory, we immediately
allocate a new blank block for it, correct? Unlike files, directories
will only ever consist of one block, so we can go ahead and allocate it
right away (whereas with a file, you wait to create a block until the
first data is written).
5. Allocation: In general, should we be zeroing out newly allocated disk
blocks as part of our allocation function? Or is this a policy decision
which we can make on our own?
6. Allocation: Should we sync the superblock eagerly after an update to
the free block bitmap (i.e. a block was either allocated or
deallocated)? This could result in a lot of disk writes, but this may be
a good tradeoff since the information in that bitmap is crucial to the
file system. If it gets corrupted, lots of data could be lost.
one of you respond? Thanks,
Daniel
1. Concurrency: Under 10.9: Issues, Dave Hovemeyer's Project 5
guidelines mention both concurrency and file sharing. We already know
that we don't have to worry about file sharing (more than one process
opening the same file). However, it is not quite clear whether we still
need to worry about concurrency. It seems not, since we are assuming
that only one process is accessing a file or directory at one time.
Additionally, VFS and the buffer cache have their own locking
mechanisms, so that should take care of our concurrency needs.
Basically, my question is: do we need to worry about locking anything,
either inside the Sys_ functions or the GOSFS_ functions?
2. Opening files: Do we create the file descriptor table entry in
Sys_Open or in GOSFS_Open? (same applies to Sys_OpenDirectory and
GOSFS_Open_Directory). It seems like we create it in Sys_Open since a
file needs an FD no matter from which filesystem it was opened.
Additionally, the semantics of the VFS Open() call suggest that we
should have an FD assigned (and therefore a File struct pointer ready)
before calling it. Where should the Malloc for that File struct occur?
It seems like it needs to happen inside our GOSFS_Open/OpenDirectory
function.
3. Opening directories: Is there any fundamental difference between
Sys_Open and Sys_OpenDirectory? It seems like you can use basically the
same code for both, with the exception of the mode parameter and the
different names for the VFS functions which it needs to call. Are there
any other things which distinguish them?
4. Creating directories: When we create a new directory, we immediately
allocate a new blank block for it, correct? Unlike files, directories
will only ever consist of one block, so we can go ahead and allocate it
right away (whereas with a file, you wait to create a block until the
first data is written).
5. Allocation: In general, should we be zeroing out newly allocated disk
blocks as part of our allocation function? Or is this a policy decision
which we can make on our own?
6. Allocation: Should we sync the superblock eagerly after an update to
the free block bitmap (i.e. a block was either allocated or
deallocated)? This could result in a lot of disk writes, but this may be
a good tradeoff since the information in that bitmap is crucial to the
file system. If it gets corrupted, lots of data could be lost.