xfs: remove XFS_HSIZE
authorChristoph Hellwig <hch@lst.de>
Thu, 15 Jun 2017 04:30:44 +0000 (21:30 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 19 Jun 2017 15:59:10 +0000 (08:59 -0700)
XFS_HSIZE is an extremly confusing way to calculate the size of handle_t.
Given that handle_t always only had two sizes, and one of them isn't
even covered by XFS_HSIZE to start with just remove the macro and use
a constant sizeof expression.

Note that XFS_HSIZE isn't used in xfsprogs, xfsdump or xfstests either.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_fs.h
fs/xfs/xfs_ioctl.c

index 095bdf049a3fe2242aed690fceb2167d4b97eaad..a9aa13e66046f7bac1db5006413aeb5956c0143c 100644 (file)
@@ -446,10 +446,6 @@ typedef struct xfs_handle {
 } xfs_handle_t;
 #define ha_fsid ha_u._ha_fsid
 
-#define XFS_HSIZE(handle)      (((char *) &(handle).ha_fid.fid_pad      \
-                                - (char *) &(handle))                    \
-                                + (handle).ha_fid.fid_len)
-
 /*
  * Structure passed to XFS_IOC_SWAPEXT
  */
index 6190697603c947d3706e102e4c00b9c391bfbe2f..f6af76975bc875a03a32f9e158887dfaa9455e64 100644 (file)
@@ -120,8 +120,7 @@ xfs_find_handle(
                handle.ha_fid.fid_pad = 0;
                handle.ha_fid.fid_gen = inode->i_generation;
                handle.ha_fid.fid_ino = ip->i_ino;
-
-               hsize = XFS_HSIZE(handle);
+               hsize = sizeof(xfs_handle_t);
        }
 
        error = -EFAULT;