2. Data StructuresData Structures
Directory contents: DIR apiDirectory contents: DIR api
Directory handles: DH apiDirectory handles: DH api
Directory inodes: DI apiDirectory inodes: DI api
Directory handle cache: DC apiDirectory handle cache: DC api
Fid support: FID apiFid support: FID api
3. Directory contentsDirectory contents
Blob of data -- size multiple of 2048Blob of data -- size multiple of 2048
bytesbytes
Contains names and NDirFids (vnode,Contains names and NDirFids (vnode,
uniq) in network orderuniq) in network order
Contains freemap, hashtable and otherContains freemap, hashtable and other
organizational structureorganizational structure
Contents stored contiguously in VenusContents stored contiguously in Venus
RVM, by page in server RVMRVM, by page in server RVM
4. Directory HandlesDirectory Handles
Contain pointers, lock and refcountsContain pointers, lock and refcounts
Stored in VM in the server in hash tableStored in VM in the server in hash table
Stored in RVM in client, pointed to byStored in RVM in client, pointed to by
fsobjs as part of VenusDirData.fsobjs as part of VenusDirData.
Most operations on directories goMost operations on directories go
through the DH api.through the DH api.
Server has a DH cache -- needed forServer has a DH cache -- needed for
Copy on Write refcounting.Copy on Write refcounting.
5. Dir InodesDir Inodes
Contain a page map for directory pagesContain a page map for directory pages
in server RVMin server RVM
Routines for retrieving and storing DH’sRoutines for retrieving and storing DH’s
in DI’s and vice versain DI’s and vice versa
Copy routineCopy routine
Guts of server directory data storageGuts of server directory data storage
6. LookupLookup
Lookup maps name to inode numberLookup maps name to inode number
Lookup must go from kernel to VenusLookup must go from kernel to Venus
through venus_lookup upcallthrough venus_lookup upcall
Mostly lookup uses inode numberMostly lookup uses inode number
computed from FIDcomputed from FID
Root directory of volume is assignedRoot directory of volume is assigned
inode number of mount point by Venusinode number of mount point by Venus
7. ReaddirReaddir
Readdir needs a Unix file handeReaddir needs a Unix file hande
(directory handle)(directory handle)
Upon open of a directory Venus writesUpon open of a directory Venus writes
out a BSD formatted directory containerout a BSD formatted directory container
filefile
File contains only names, no inodeFile contains only names, no inode
numbers or types (POSIX says this isnumbers or types (POSIX says this is
all we need).all we need).