[OpenAFS-devel] Re: What is needed to build an AFS fileserver
on top of BTRFS?
Jeffrey Hutzelman
jhutz@cmu.edu
Tue, 17 Dec 2013 13:42:28 -0500
On Tue, 2013-12-17 at 17:40 +0000, David Howells wrote:
> Chris Mason <clm@fb.com> wrote:
>
> > Hmmm, what exactly are vnodes? Could we put them in xattrs?
>
> vnode numbers are AFS's equivalent of inode numbers. Since they're one per
> file, they could be the object filename.
Yes, in fact, the volume, vnode number, uniqifier, and DV are
effectively the "name" the fileserver uses for the underlying inode.
Note that if the fileserver is maintaining the vnode indices, then you
don't actually _need_ to store a uniqifier for normal operation, because
at any given time, a volume can contain at most one vnode with a
particular vnode number, and that vnode's uniqifier is stored in the
index. The uniqifier is used on-the-wire to distinguish different files
that existed at different points in time with the same vnode number.
> Probably there would have to be a table of {vnode,latest_uniquifier} as the
> uniquifier must still go up even if the vnode is unused for a while, so there
> could also be a table of {vnode,btrfs_file}.
No, you don't actually have to do this. The OpenAFS fileserver
maintains a single uniqifier for an entire volume, and simply increments
it every time a vnode is created.
-- Jeff