cs412050
2005-04-24 19:06:09 UTC
When I create a file, I use Allocate_File() and store the
file pointer to **pFile passed from Sys_Open.
At this point, (struct File *)file and (struct GOSFS_Dir_Entry *)entry
are not related each other. It is fine at this point, but,
Beginning to write blocks and putting block number in entry->blockList
is confusing without knowing each other.
How can open file knows its dir_entry is *entry without having any
information in it? In other words, struct File doesn't have member
as a back pointer to Dir_Entry and struct Dir_Entry doesn't have
struct File * either. How can I map FS_Buffer to this file,
and update when I sync() or close() the file?
I tried to solve this by filename, but struct File doesn't have name
member either. Anybody considered this? Or am I in the wrong direction
again, as I did last project?
file pointer to **pFile passed from Sys_Open.
At this point, (struct File *)file and (struct GOSFS_Dir_Entry *)entry
are not related each other. It is fine at this point, but,
Beginning to write blocks and putting block number in entry->blockList
is confusing without knowing each other.
How can open file knows its dir_entry is *entry without having any
information in it? In other words, struct File doesn't have member
as a back pointer to Dir_Entry and struct Dir_Entry doesn't have
struct File * either. How can I map FS_Buffer to this file,
and update when I sync() or close() the file?
I tried to solve this by filename, but struct File doesn't have name
member either. Anybody considered this? Or am I in the wrong direction
again, as I did last project?