]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_io: refactor inode command
authorEric Sandeen <sandeen@sandeen.net>
Sun, 2 Oct 2016 23:50:21 +0000 (10:50 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 2 Oct 2016 23:50:21 +0000 (10:50 +1100)
commitd5b046de584df2577e7ed180c7371f6ab9dd2d4b
treeb3e3a8520ee35a1acebbff426b3d6ade3cd305ab
parent5afa1b2d0f2c4039c9b580cbe6f3acc96a3f9663
xfs_io: refactor inode command

The inode_f function is a bit convoluted; the default
find-last-inode case appears at the end, there are several return
points, we print the same basic information using 2 different
variables in 2 different locations depending on the mode we're in,
the "inode not found" was a printf & exit in the middle of the
function, etc.

Move the default case up to the top so it's more obvious, not
buried.

Make a new var, result_ino, which holds whatever we want to print
regardless of the mode, and then handle all the output at the end.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
io/open.c