| To: | Dave Chinner <david@xxxxxxxxxxxxx> |
|---|---|
| Subject: | [PATCH v4, 07/16] xfsprogs: metadump: use pointers in generate_obfuscated_name() |
| From: | Alex Elder <aelder@xxxxxxx> |
| Date: | Fri, 25 Feb 2011 12:13:40 -0600 |
| Cc: | xfs@xxxxxxxxxxx |
| In-reply-to: | <20110224014712.GU3166@dastard> |
| References: | <201102182121.p1ILL1AZ029097@xxxxxxxxxxxxxxxxxxxxxx> <20110224014712.GU3166@dastard> |
| Reply-to: | aelder@xxxxxxx |
. . .
> One small comment below, otherwise:
>
> Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
>
> > @@ -500,16 +502,17 @@ generate_obfuscated_name(
> > */
> > newhash = rol32(newhash, 3) ^ hash;
> >
> > + first = newp;
> > high_bit = 0;
> > - for (i = 5; i > 0; i--) {
> > - int shift = (i - 1) * 7;
> > -
> > - newp[namelen - i] = ((newhash >> shift) & 0x7f) ^
> > high_bit;
> > - if (is_invalid_char(newp[namelen - i])) {
> > - newp[namelen - i] ^= 1;
> > + for (shift = 28; shift >= 0; shift -= 7) {
> > + *newp = (newhash >> shift & 0x7f) ^ high_bit;
>
> I'd prefer not to have to refer to my C bible to remind myself what
> the precedence of ">>" vs "&" is, so perhaps leaving the second set
> of () in this statement would be a good idea.
Done.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH v4, 01/16] xfsprogs: metadump: some names aren't all that special, Alex Elder |
|---|---|
| Next by Date: | [PATCH v4, 09/16] xfsprogs: metadump: don't loop on too many dups, Alex Elder |
| Previous by Thread: | Re: [PATCH v3, 07/16] xfsprogs: metadump: use pointers in generate_obfuscated_name(), Dave Chinner |
| Next by Thread: | [PATCH v3, 06/16] xfsprogs: metadump: replace repeated blocks with a loop, Alex Elder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |