On Tue, Oct 07, 2003 at 11:42:10AM -0400, Pisupati, Ajay wrote:
> Ethan,
>
> I am making the following changes to the code and I wanted to check w/ you.
>
> 1) adding the following two fields to the __fsdriver struct.
> void *file_ptr <- this is where you would store your EXT2_FILE
> void *filefs_ptr <- for saving EXT2_FS
> I think this is logically the correct place to put it because these are
> internal to a fs driver
>
> 2) I am going to implement the following struct
> {
> char *device /* device node */
> char *partition /* device partition? */
> char *alias /* alias for the above device node - eg: hd:3 */
> __fsdriver *driver /* stores correct fs driver for this
> particular partition */
> int fs /* ? Maybe the magic number */
> }
> I was thinking that we could use this struct to store the correct fs driver
> for a particular device node (and partition) after we call fs->verify().
> Store an array of these things and then use them later. do you think this
> type of setup would be good for getcwd() and chdir()? I will try and check
> the kernel code to see how the kernel implements this to get an idea how to
> proceed. unfortunately, this the first time that I am looking at the code,
> so it is taking me a while. Do you have any ideas on implementing these two
> things? I think we have to keep track of where we are in the FS
> constantly, because the first step is getting _to_ someplace is know _where_
> we are. again, my guess is that the kernel does something similar but I
> don't know where...
one more thing to keep in mind, we need to add a layer to this for
handling partition tables, we cannot depend on OF for this as many
implementations have broken disklabel packages.
so internally when we open() hd:3 hd:0 needs to be opened, checked for
partition table, figure out the geometry for partition 3, and then
offset and restrict any read() and lseek() calls to be within that
partition. probably most of this can be handled in the rawio driver.
--
Ethan Benson
http://www.alaska.net/~erbenson/
Attachment:
pgp00002.pgp
Description: PGP signature