Hide any items that do not need to be exposed to FUSE. Currently, the only thing that FUSE needs is the file descriptor and the dirty flag. However, its better to store a pointer to this struct in FUSE for constant- order searching of the record for a file. So, move all other fields into another struct and save a void pointer to that struct within this struct. This way only the Buffer Cache code can access the internal fields, whereas FUSE can use the values that it is concerned with.
Implement access() correctly when the file is not open. This should involve check the uid and gid of the file and the current user and the access permissions set in st_mode in the file's attributes.
Global shingledfs_chown (const char *path, uid_t uid, gid_t gid)
Fix this function to account for Attribute Replication
Global shingledfs_link (const char *path, const char *path_target)
This function might not be suited for the ShingledFS architecture. Consider what happens to a hard link when the target is opened. The file is deleted and replaced with a symlink to a file on tmpFS. With the deletion, the hard link is removed! Unless the hard links are tracked and recreated on each open and BC eviction, this is bound to fail!
This function does not need to update the inode information as that will result in leaking of data blocks. Instead, ensure that when a file is loaded, the number of blocks is calculated based on its actual file size; NOT the no. of blocks saved in the inode.