70 likes | 246 Views
Coda Directory Handling. Peter J Braam. Data Structures. Directory contents: DIR api Directory handles: DH api Directory inodes: DI api Directory handle cache: DC api Fid support: FID api. Directory contents. Blob of data -- size multiple of 2048 bytes
E N D
Coda Directory Handling Peter J Braam
Data Structures • Directory contents: DIR api • Directory handles: DH api • Directory inodes: DI api • Directory handle cache: DC api • Fid support: FID api
Directory contents • Blob of data -- size multiple of 2048 bytes • Contains names and NDirFids (vnode, uniq) in network order • Contains freemap, hashtable and other organizational structure • Contents stored contiguously in Venus RVM, by page in server RVM
Directory Handles • Contain pointers, lock and refcounts • Stored in VM in the server in hash table • Stored in RVM in client, pointed to by fsobjs as part of VenusDirData. • Most operations on directories go through the DH api. • Server has a DH cache -- needed for Copy on Write refcounting.
Dir Inodes • Contain a page map for directory pages in server RVM • Routines for retrieving and storing DH’s in DI’s and vice versa • Copy routine • Guts of server directory data storage
Lookup • Lookup maps name to inode number • Lookup must go from kernel to Venus through venus_lookup upcall • Mostly lookup uses inode number computed from FID • Root directory of volume is assigned inode number of mount point by Venus
Readdir • Readdir needs a Unix file hande (directory handle) • Upon open of a directory Venus writes out a BSD formatted directory container file • File contains only names, no inode numbers or types (POSIX says this is all we need).