Iulian Neamtiu
2005-04-18 17:45:28 UTC
You don't have to do much in gosfs.c::GOSFS_Mount(), the bulk is already
done for you in vfs.c::Mount(). In principle, you need to check whether
the device you're trying to mount is a legit GOSFS device (i.e.
formatted) and if so, create a buffer cache for the device and use it
thereafter for all disk I/O operations.
Technically speaking:
- you need to create a buffer cache and save it in mountPoint->fsData;
even better, create a structure GOSFS_Instance that contains whatever
info you need associated with a mount point (e.g. buffer cache, pointer
to superblock, cache of the root directory, etc.) and point fsData to an
instance of that structure.
- then, using the buffer cache, read the superblock for the device and
check its validity (magic number, that is)
- set mountPoint->ops to be &s_gosfsMountPointOps
- return 0 if all went well, or error code otherwise (take one from errno.h)
Iulian
done for you in vfs.c::Mount(). In principle, you need to check whether
the device you're trying to mount is a legit GOSFS device (i.e.
formatted) and if so, create a buffer cache for the device and use it
thereafter for all disk I/O operations.
Technically speaking:
- you need to create a buffer cache and save it in mountPoint->fsData;
even better, create a structure GOSFS_Instance that contains whatever
info you need associated with a mount point (e.g. buffer cache, pointer
to superblock, cache of the root directory, etc.) and point fsData to an
instance of that structure.
- then, using the buffer cache, read the superblock for the device and
check its validity (magic number, that is)
- set mountPoint->ops to be &s_gosfsMountPointOps
- return 0 if all went well, or error code otherwise (take one from errno.h)
Iulian