aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-09-09 15:37:07 -0400
committerEric Sandeen <sandeen@redhat.com>2019-09-09 15:37:07 -0400
commit8990666efce422c2dbe89765ec0730e179a3c3c3 (patch)
tree986525b5baf23f0797f389a84067a1aa0cdde735
parent10cfd61e80f7d7d5d0b01d0f422db9e68330d5b4 (diff)
downloadxfsprogs-dev-8990666efce422c2dbe89765ec0730e179a3c3c3.tar.gz
xfs_spaceman: remove unnecessary test in openfile()
xfs_spaceman always records fs_path information for an open file because spaceman requires running on XFS and it always passes a non-null fs_path to openfile. Therefore, openfile doesn't need the fs_path null check. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--spaceman/file.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/spaceman/file.c b/spaceman/file.c
index 5647ca7df2..29b7d9ce58 100644
--- a/spaceman/file.c
+++ b/spaceman/file.c
@@ -71,16 +71,15 @@ _("%s: Not on a mounted XFS filesystem.\n"),
return -1;
}
- if (fs_path) {
- fsp = fs_table_lookup(path, FS_MOUNT_POINT);
- if (!fsp) {
- fprintf(stderr, _("%s: cannot find mount point."),
- path);
- close(fd);
- return -1;
- }
- memcpy(fs_path, fsp, sizeof(struct fs_path));
+ fsp = fs_table_lookup(path, FS_MOUNT_POINT);
+ if (!fsp) {
+ fprintf(stderr, _("%s: cannot find mount point."),
+ path);
+ close(fd);
+ return -1;
}
+ memcpy(fs_path, fsp, sizeof(struct fs_path));
+
return fd;
}