xfsprogs: metadump: move duplicate name handling into its own function
Move the handling of duplicate names into its own function. As a
result, all names other than "lost+found" files (not just those that
get obfuscated) will be checked to avoid duplication.
This makes the local buffer newname[] in generate_obfuscated_name()
unnecessary, so just drop it and use the passed-in name.
Updates:
- A comment about handling of a leading '/' character is now modified
to match the updated code, rather than being deleted altogether.
- Renamed handle_duplicates() to be handle_duplicate_name().
Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>