[PATCH v3, 02/16] xfsprogs: metadump: simplify '/' handling in generate_obfuscated_name()

Dave Chinner david at fromorbit.com
Wed Feb 23 19:28:43 CST 2011


On Fri, Feb 18, 2011 at 03:21:01PM -0600, Alex Elder wrote:
> In generate_obfuscated_name(), the incoming name is allowed to start
> with a '/' character, in which case it is copied over to the new
> name and ignored for the remainder of the hash calculation.  A '/'
> character is needlessly included at the beginning of each name
> stashed in the duplicates table (regardless of whether one was
> present in the name provided).
> 
> Simplify the affected code by processing the '/' right away, and
> using a pointer thereafter for the start of the new name.  Stop
> including a leading '/' in the name used for duplicate detection.
> 
> Note:  It is not clear a leading '/' character is ever even present
> in a name presented for obfuscation.  I have not investigated this
> question; this change merely adjusts the code while preserving its
> original functionality.
> 
> Signed-off-by: Alex Elder <aelder at sgi.com>
> 
> No significant changes in this version from the last one posted.

Looks sane.

Reviewed-by: Dave Chinner <dchinner at redhat.com>

-- 
Dave Chinner
david at fromorbit.com




More information about the xfs mailing list