]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: metadump: some names aren't all that special
authorAlex Elder <aelder@sgi.com>
Fri, 25 Feb 2011 18:13:37 +0000 (18:13 +0000)
committerAlex Elder <aelder@sgi.com>
Tue, 8 Mar 2011 18:03:56 +0000 (12:03 -0600)
commit56281ed43abe95e96e45d2287fd0b965b7d4d2b8
tree3209094884b631d110c51ca6ecdbf9bdb16df00c
parentfb380cb7606e7e92abc73e1a9bd644e7c88a04a8
xfsprogs: metadump: some names aren't all that special

Move the check for short names out of is_special_dirent() and into
generate_obfuscated_name().  That way the check is more directly
associated with the algorithm that requires it.

Similarly, move the check for inode == 0, since that case has to do
with storing extended attributes (not files) in the name table.

As a result, is_special_dirent() is really only focused on whether a
given file is in the lost+found directory.  Rename the function to
reflect its more specific purpose.

Updates (v3):
- The previous version did not properly skip the "lost+found"
  directory itself; this one does.
- Created a new definition representing the name of the orphanage
  directory.  Encapsulate recognizing that directory into a new
  macro, is_lost_found().
- Removed casts that eliminate a compile warning in calls to
  libxfs_da_hashname(); will do them separately later if needed.
Updates (v4):
- Renamed is_lost_found() to be is_orphanage_dir(), and turned
  it into an inline static function.
- Added parentheses around targets of the sizeof operation.
- Added a small bit of clarifying commentary in spots where
  it was suggested.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
db/metadump.c