#include <fat.h>
Data Fields | |
devmap_handle_t | devmap_handle |
fs_index_t | index |
fibril_mutex_t | lock |
fat_node * | nodep |
Pointer to in-core node instance. | |
unsigned | pdi |
Directory entry index within the parent node. | |
fat_cluster_t | pfc |
Parent node's first cluster. | |
link_t | uih_link |
Used indices (index) hash table link. | |
link_t | uph_link |
Used indices (position) hash table link. |
This structure exists to help us to overcome certain limitations of the FAT file system design. The problem with FAT is that it is hard to find an entity which could represent a VFS index. There are two candidates:
a) number of the node's first cluster b) the pair of the parent directory's first cluster and the dentry index within the parent directory
We need VFS indices to be: A) unique B) stable in time, at least until the next mount
Unfortunately a) does not meet the A) criterion because zero-length files will have the first cluster field cleared. And b) does not meet the B) criterion because unlink() and rename() will both free up the original dentry, which contains all the essential info about the file.
Therefore, a completely opaque indices are used and the FAT server maintains a mapping between them and otherwise nice b) variant. On rename(), the VFS index stays unaltered, while the internal FAT "physical tree address" changes. The unlink case is also handled this way thanks to an in-core node pointer embedded in the index structure.
Definition at line 170 of file fat.h.