xfsprogs: metadump: encapsulate the nametable code
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@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>