[Top] [All Lists]

Re: XFS Filename Hash and metadump

To: Michael Monnerie <michael.monnerie@xxxxxxxxxxxxxxxxxxx>
Subject: Re: XFS Filename Hash and metadump
From: Alex Elder <aelder@xxxxxxx>
Date: Thu, 07 Oct 2010 16:41:49 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <201010052328.34390@xxxxxx>
References: <1286290547.1960.3.camel@doink> <201010052328.34390@xxxxxx>
Reply-to: aelder@xxxxxxx
On Tue, 2010-10-05 at 23:28 +0200, Michael Monnerie wrote:
> On Dienstag, 5. Oktober 2010 Alex Elder wrote:
> > PS  Two more observations:
> >     - There is really no need for the characters to be truly random.
> >       Making the generated name unique and different from the
> >       original is sufficient.  So (with the exception of the last
> >       five bytes) we can select the characters however we like.
> >       They could be a sequential series of names, for example,
> >       rather than computing a random value for each.
> I was thinking the same when reading your description. Why not simply 
> "number" the file names from 1 to whatever count of files/dirs there is 
> within that dir?

I'm not entirely sure how best to implement it, and I'm open to

As a starting point, I will make it so the random characters making
up the first part of the name are printable, and could probably restrict
it even more than that (say, using lower-case alphabetic and numeric

A scheme with incrementing file names would need to accomodate names of
arbitrary length, too, and it might be better to make the varying part
be at the front of such names.

We need to be aware that there could be duplicates (filenames hashing
to the same value), even though that's unlikely.

In any case the last four and a half bytes of the name will need to
be in the full 8-bit range to make the hash work out right.

I have a few ideas for all of the above.  They didn't get out in my
first draft of the patch series because like I said I wanted to get
early feedback rather than waiting to get other stuff implemented.


<Prev in Thread] Current Thread [Next in Thread>