[Pvfs2-developers] PVFS2 steps for file/dir/block operation?

Rob Ross rross at mcs.anl.gov
Sat Oct 7 15:20:44 EDT 2006


Hi Peng,

For file/dir deletion, we remove the corresponding directory entry first 
to guarantee that the object is no longer visible, then we begin tearing 
down whatever objects are left (metadata, datafiles, etc.).

For rename we first create the new directory entry, then remove the old 
directory entry (so there is a window of time where the object has two 
"names", but may be correctly accessed under either), then remove 
anything that used to be referred to by the new name.

Block allocation is handled by the underlying local file systems; we 
don't have to do anything there.

Generally you can figure this sort of stuff out by looking at the state 
machine state names; they're fairly descriptive.

Rob

Peng Gu wrote:
> I am studying the way PVFS2 takes to keep its filesystem consistency.
> For example, pvfs2-guide tell us the steps for PVFS2 to create a file
> on webpage http://www.pvfs.org/pvfs2-guide.html#SECTION00036000000000000000
> 
> Here is some sentences cited from that page:
> 
> "Here are the steps necessary to create a new file in PVFS2:
> 
> create a directory entry for the new file
> create a metadata object for the new file
> point the directory entry to the metadata object
> create a set of data objects to hold data for the new file
> point the metadata at the data objects
> 
> Performing those steps in that particular order results in file system
> states where a directory entry exists for a file that is not really
> ready to be accessed. If we carefully order the operations:
> 
> 1. create the data objects to hold data for the new file
> 2. create a metadata object for the new file
> 3. point the metadata at the data objects
> 4. create a directory entry for the new file pointing to the metadata 
> object
> 
> we create a sequence of states that always leave the file system
> directory hierarchy in a consistent state. The file is either there
> (and ready to be accessed) or it isn't. All PVFS2 operations are
> performed in this manner."
> 
> Can anybody tell me the steps PVFS2 takes for other operations like
> file/dir deletion, file renaming, free space/block allocation/release.
> 
> Thanks,
> Peng



More information about the Pvfs2-developers mailing list