fat_idx_t Struct Reference
[Fs]

FAT index structure. More...

#include <fat.h>


Data Fields

devmap_handle_t devmap_handle
fs_index_t index
fibril_mutex_t lock
fat_nodenodep
 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.


Detailed Description

FAT index structure.

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.


Field Documentation

fat_cluster_t pfc

Parent node's first cluster.

Zero is used if this node is not linked, in which case nodep must contain a pointer to the in-core node structure. One is used when the parent is the root directory.

Definition at line 185 of file fat.h.


The documentation for this struct was generated from the following file:
Generated on Thu Jun 2 07:45:59 2011 for HelenOS/USB by  doxygen 1.4.7