From: Darrick J. Wong Date: Mon, 9 Sep 2019 19:37:07 +0000 (-0400) Subject: xfs_spaceman: remove unnecessary test in openfile() X-Git-Tag: v5.3.0-rc2~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8990666efce422c2dbe89765ec0730e179a3c3c3;p=thirdparty%2Fxfsprogs-dev.git 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 Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- diff --git a/spaceman/file.c b/spaceman/file.c index 5647ca7df..29b7d9ce5 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; }