Skip to content

Commit

Permalink
xfs: remove XFS_HSIZE
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eric Sandeen <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
  • Loading branch information
Christoph Hellwig authored and djwong committed Jun 19, 2017
1 parent d4ca1d5 commit 3398a40
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions fs/xfs/libxfs/xfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 1 addition & 2 deletions fs/xfs/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3398a40

Please sign in to comment.