[K42-discussion] Volatile directories and revalidation patch

Patrick Bozeman PEBozeman at lbl.gov
Thu Sep 21 12:42:44 EST 2006


This patch probably could have been split into a few pieces, but they 
are somewhat intertwined.   Let me know if you want it broken up.  The 
patch provides 3 things:

1) Provides a FileInfoVirtFSDirVolatile class.  This class is actually a 
combo of static and dynamic directory functionality.  It has 
FileInfoVirtFSDirStatic as its base class, so it is possible to add 
static files and perform lookups on them using the static dir methods.  
However, it overrides key methods such as directory enumeration and 
object lookup.  For such methods, it first calls the static dir method 
and then a dynamic method implemented by derived classes.  This is of 
course useful for directories such as /proc that has a mix of static and 
dynamic content, and for directories like /proc/<pid>/fd that have only 
dynamic content.

2) getRecLen was moved from a static function in FileInfoVirtFS.C to a 
static member function of FileInfoVirtFSDirBase.  This enables derived 
classes outside of this compilation unit to call it (e.g. the derived 
classes used in the procfs server.)

3)  Provides isStale() and shouldRevalidate() methods to the 
FileInfoVirtFSDir class hierarchy and calls them from 
ServerFileDirVirtFS  to check and potentially trigger revalidation.   
This causes revalidation to occur before a stale object gets used rather 
than after as was the case before this change.  (And it largely avoids 
the bug from my previous email.)

People may have stylistic issues with part number 1 of the patch. Let me 
know what you think.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: voldir-and-reval.patch
Type: text/x-patch
Size: 10657 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/k42-discussion/attachments/20060920/32647686/attachment.bin 


More information about the K42-discussion mailing list