Page 1 of 1

Filesystem design considerations

Posted: Tue Jan 22, 2008 11:02 am
by Cemre
Hello all :)

I am currently writing a filesystem with following basic design:

a "directory" is a list of "directory entries"
each "directory entry" points to an "inode" ( an inode is a file descriptor )
an "inode" is a list of "fragment descriptor"s
a "fragment descriptor" describes the start and size of that file fragment.

since a directory is a special file; an "inode" can also describe a directory.

"attributes" must be defined for each file ( rwx bits, filesize, filename, type [directory/file], last-access/last-modify/creation date/time, owner, last-accessor, last-modifier and other possible attributes )

my question is "where should i put those attributes?"
1) to the directory entry of the directory where this file is referenced from
2) to the inode of the file itself ( as a header )

I am also open to "put filename to direntry, put filesize to inode" like answers. ( with argument of "why" )

Best regards.

Posted: Tue Jan 22, 2008 11:38 am
by mathematician
All depends upon whether you are going to allow multiple dircetory references to the same file. If you want all user's to see the same permissions then they should be in the inode; if you want a supervisor to have read/write permission, but a user to have only read permission, then the permissions should be in their respective directories. The same goes for things like filesize; a file can only have one size, and it would be easier to update that size in the inode than in multiple directory entries.

If, however, files are only ever going to appear in one directory at a time, it probably doesn't matter that much.