tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Implementation Proposal for Subfile GSoC



I'll be implementing subfile support and wanted to get some feedback on what the community thinks of the additions/design decisions my mentor and I have been thinking of making. Any questions and/or comments are welcome.


Changes that need to be made to the file system
o Add a flag to the file system superblock to show if subfiles are supported on the filesystem
          o Add two new inode types ( IFSFDIR and IFSFREG )

An IFSFDIR:
* is referenced by exactly one base inode, add a back pointer to the inode struct
* contents are same as normal directory, struct direct.
* contains a “.” entry that references the IFSFDIR.
* contains a “..” entry that references the base inode
* entries may only reference IFSFREG there may be no subdirectories or device nodes
* is instantiated on demand
* is removed when the base inode is removed
* does not have independent access control (uid, gid, mode), refer the the base inode

An IFSFREG:
* is just like an IFREG
* could (should?) contain a back pointer to the IFSFDIR
* can only have a link count of 1
* can be deleted explicitly (see subfile_remove(), below)
* is deleted when the base inode is deleted
* does not have independent access control (uid, gid, mode), refer the the base inode

When a base inode is deleted, the subfile tree has to be deleted also. Changes to remove() would be needed.


OS Level - System Calls
* o int subfile_fdopen (int basefilefd, char * subfilename, int open_flags); + subfile_fdopen acts much like regular fdopen(2) except it is passed a basefile fd to open then opens the subfile of the basefile. o int subfile_open (char * basefilename, char * subfilename, int open_flags); + subfile_fdopen is the same as subfile_open except it uses a file descriptor to reference the basefile.

Both of these open functions would return a normal file descriptor to the subfile upon a successful open, a fd that can be used with normal read, write, close, etc.

* o opendir -modified to open the sub_file folder of a file if the file’s inode contains a sub_file folder reference o int subfile_stat (char * basefilename, char * subfilename, struct stat * sb); o int subfile_fdstat (int basefilefd, char * subfilename, struct stat * sb); o int subfile_remove (char * basefilename, char * subfilename);
          o int subfile_fdremove (int basefilefd, char * subfilename);


Adam Burkepile
sadpoti%gmail.com@localhost





Home | Main Index | Thread Index | Old Index