📄 coda.txt
字号:
SSuummmmaarryy Read or write from a file AArrgguummeennttss iinn struct cfs_rdwr_in { ViceFid VFid; int rwflag; int count; int offset; int ioflag; caddr_t data; /* Place holder for data. */ } cfs_rdwr; oouutt struct cfs_rdwr_out { int rwflag; int count; caddr_t data; /* Place holder for data. */ } cfs_rdwr; DDeessccrriippttiioonn This upcall asks Venus to read or write from a file. EErrrroorrss NNOOTTEE It should be removed since it is against the Coda philosophy that read/write operations never reach Venus. I have been told the operation does not work. It is not currently used. 0wpage 44..2244.. ooddyymmoouunntt SSuummmmaarryy Allows mounting multiple Coda "filesystems" on one Unix mount point. AArrgguummeennttss iinn struct ody_mount_in { char *name; /* Place holder for data. */ } ody_mount; oouutt struct ody_mount_out { ViceFid VFid; } ody_mount; DDeessccrriippttiioonn Asks Venus to return the rootfid of a Coda system named name. The fid is returned in VFid. EErrrroorrss NNOOTTEE This call was used by David for dynamic sets. It should be removed since it causes a jungle of pointers in the VFS mounting area. It is not used by Coda proper. Call is not implemented by Venus. 0wpage 44..2255.. ooddyy__llooookkuupp SSuummmmaarryy Looks up something. AArrgguummeennttss iinn irrelevant oouutt irrelevant DDeessccrriippttiioonn EErrrroorrss NNOOTTEE Gut it. Call is not implemented by Venus. 0wpage 44..2266.. ooddyy__eexxppaanndd SSuummmmaarryy expands something in a dynamic set. AArrgguummeennttss iinn irrelevant oouutt irrelevant DDeessccrriippttiioonn EErrrroorrss NNOOTTEE Gut it. Call is not implemented by Venus. 0wpage 44..2277.. pprreeffeettcchh SSuummmmaarryy Prefetch a dynamic set. AArrgguummeennttss iinn Not documented. oouutt Not documented. DDeessccrriippttiioonn Venus worker.cc has support for this call, although it is noted that it doesn't work. Not surprising, since the kernel does not have support for it. (ODY_PREFETCH is not a defined operation). EErrrroorrss NNOOTTEE Gut it. It isn't working and isn't used by Coda. 0wpage 44..2288.. ssiiggnnaall SSuummmmaarryy Send Venus a signal about an upcall. AArrgguummeennttss iinn none oouutt not applicable. DDeessccrriippttiioonn This is an out-of-band upcall to Venus to inform Venus that the calling process received a signal after Venus read the message from the input queue. Venus is supposed to clean up the operation. EErrrroorrss No reply is given. NNOOTTEE We need to better understand what Venus needs to clean up and if it is doing this correctly. Also we need to handle multiple upcall per system call situations correctly. It would be important to know what state changes in Venus take place after an upcall for which the kernel is responsible for notifying Venus to clean up (e.g. open definitely is such a state change, but many others are maybe not). 0wpage 55.. TThhee mmiinniiccaacchhee aanndd ddoowwnnccaallllss The Coda FS Driver can cache results of lookup and access upcalls, to limit the frequency of upcalls. Upcalls carry a price since a process context switch needs to take place. The counterpart of caching the information is that Venus will notify the FS Driver that cached entries must be flushed or renamed. The kernel code generally has to maintain a structure which links the internal file handles (called vnodes in BSD, inodes in Linux and FileHandles in Windows) with the ViceFid's which Venus maintains. The reason is that frequent translations back and forth are needed in order to make upcalls and use the results of upcalls. Such linking objects are called ccnnooddeess. The current minicache implementations have cache entries which record the following: 1. the name of the file 2. the cnode of the directory containing the object 3. a list of CodaCred's for which the lookup is permitted. 4. the cnode of the object The lookup call in the Coda FS Driver may request the cnode of the desired object from the cache, by passing its name, directory and the CodaCred's of the caller. The cache will return the cnode or indicate that it cannot be found. The Coda FS Driver must be careful to invalidate cache entries when it modifies or removes objects. When Venus obtains information that indicates that cache entries are no longer valid, it will make a downcall to the kernel. Downcalls are intercepted by the Coda FS Driver and lead to cache invalidations of the kind described below. The Coda FS Driver does not return an error unless the downcall data could not be read into kernel memory. 55..11.. IINNVVAALLIIDDAATTEE No information is available on this call. 55..22.. FFLLUUSSHH AArrgguummeennttss None SSuummmmaarryy Flush the name cache entirely. DDeessccrriippttiioonn Venus issues this call upon startup and when it dies. This is to prevent stale cache information being held. Some operating systems allow the kernel name cache to be switched off dynamically. When this is done, this downcall is made. 55..33.. PPUURRGGEEUUSSEERR AArrgguummeennttss struct cfs_purgeuser_out {/* CFS_PURGEUSER is a venus->kernel call */ struct CodaCred cred; } cfs_purgeuser; DDeessccrriippttiioonn Remove all entries in the cache carrying the Cred. This call is issued when tokens for a user expire or are flushed. 55..44.. ZZAAPPFFIILLEE AArrgguummeennttss struct cfs_zapfile_out { /* CFS_ZAPFILE is a venus->kernel call */ ViceFid CodaFid; } cfs_zapfile; DDeessccrriippttiioonn Remove all entries which have the (dir vnode, name) pair. This is issued as a result of an invalidation of cached attributes of a vnode. NNOOTTEE Call is not named correctly in NetBSD and Mach. The minicache zapfile routine takes different arguments. Linux does not implement the invalidation of attributes correctly. 55..55.. ZZAAPPDDIIRR AArrgguummeennttss struct cfs_zapdir_out { /* CFS_ZAPDIR is a venus->kernel call */ ViceFid CodaFid; } cfs_zapdir; DDeessccrriippttiioonn Remove all entries in the cache lying in a directory CodaFid, and all children of this directory. This call is issued when Venus receives a callback on the directory. 55..66.. ZZAAPPVVNNOODDEE AArrgguummeennttss struct cfs_zapvnode_out { /* CFS_ZAPVNODE is a venus->kernel call */ struct CodaCred cred; ViceFid VFid; } cfs_zapvnode; DDeessccrriippttiioonn Remove all entries in the cache carrying the cred and VFid as in the arguments. This downcall is probably never issued. 55..77.. PPUURRGGEEFFIIDD SSuummmmaarryy AArrgguummeennttss struct cfs_purgefid_out { /* CFS_PURGEFID is a venus->kernel call */ ViceFid CodaFid; } cfs_purgefid; DDeessccrriippttiioonn Flush the attribute for the file. If it is a dir (odd vnode), purge its children from the namecache and remove the file from the namecache. 55..88.. RREEPPLLAACCEE SSuummmmaarryy Replace the Fid's for a collection of names. AArrgguummeennttss struct cfs_replace_out { /* cfs_replace is a venus->kernel call */ ViceFid NewFid; ViceFid OldFid; } cfs_replace; DDeessccrriippttiioonn This routine replaces a ViceFid in the name cache with another. It is added to allow Venus during reintegration to replace locally allocated temp fids while disconnected with global fids even when the reference counts on those fids are not zero. 0wpage 66.. IInniittiiaalliizzaattiioonn aanndd cclleeaannuupp This section gives brief hints as to desirable features for the Coda FS Driver at startup and upon shutdown or Venus failures. Before entering the discussion it is useful to repeat that the Coda FS Driver maintains the following data: 1. message queues 2. cnodes 3. name cache entries The name cache entries are entirely private to the driver, so they can easily be manipulated. The message queues will generally have clear points of initialization and destruction. The cnodes are much more delicate. User processes hold reference counts in Coda filesystems and it can be difficult to clean up the cnodes. It can expect requests through: 1. the message subsystem 2. the VFS layer 3. pioctl interface Currently the _p_i_o_c_t_l passes through the VFS for Coda so we can treat these similarly. 66..11.. RReeqquuiirreemmeennttss The following requirements should be accommodated: 1. The message queues should have open and close routines. On Unix the opening of the character devices are such routines. +o Before opening, no messages can be placed. +o Opening will remove any old messages still pending. +o Close will notify any sleeping processes that their upcall cannot be completed. +o Close will free all memory allocated by the message queues. 2. At open the namecache shall be initialized to empty state. 3. Before the message queues are open, all VFS operations will fail. Fortunately this can be achieved by making sure than mounting the Coda filesystem cannot succeed before opening. 4. After closing of the queues, no VFS operations can succeed. Here one needs to be careful, since a few operations (lookup, read/write, readdir) can proceed without upcalls. These must be explicitly blocked. 5. Upon closing the namecache shall be flushed and disabled. 6. All memory held by cnodes can be freed without relying on upcalls. 7. Unmounting the file system can be done without relying on upcalls. 8. Mounting the Coda filesystem should fail gracefully if Venus cannot get the rootfid or the attributes of the rootfid. The latter is best implemented by Venus fetching these objects before attempting to mount. NNOOTTEE NetBSD in particular but also Linux have not implemented the above requirements fully. For smooth operation this needs to be corrected.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -