xfs
[Top] [All Lists]

Re: [PATCH v3, 10/16] xfsprogs: metadump: encapsulate the nametable code

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH v3, 10/16] xfsprogs: metadump: encapsulate the nametable code
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 24 Feb 2011 13:00:25 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <201102182121.p1ILL2oE029134@xxxxxxxxxxxxxxxxxxxxxx>
References: <201102182121.p1ILL2oE029134@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Feb 18, 2011 at 03:21:01PM -0600, Alex Elder wrote:
> The name table used to find duplicates in metadump.c is allocated
> dynamically, but there's no real need to do so.  Just make it a BSS
> global array and drop the initialization call.
> 
> Meanwhile, encapsulate the code that adds entries to and looks up
> entries in the table into their own functions.  Use the lookup
> function to detect a duplicate name in a case not previously
> checked.
> 
> Change the naming scheme to use "nametable" as a prefix rather than
> a suffix.
> 
> Finally, now that it's easy to do so, issue a warning if we find
> that we're falling back to not obfuscating the name, but that name
> has already been used in the current directory.  (This can happen if
> a obfuscated earlier happens to match a subsequently found "real"
> name.)
> 
> Signed-off-by: Alex Elder <aelder@xxxxxxx>

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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