linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: remove XFS_HSIZE
Date: Tue, 9 May 2017 08:40:00 -0700	[thread overview]
Message-ID: <20170509154000.GO5973@birch.djwong.org> (raw)
In-Reply-To: <20170509090018.30094-1-hch@lst.de>

On Tue, May 09, 2017 at 11:00:18AM +0200, Christoph Hellwig wrote:
> 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: Darrick J. Wong <darrick.wong@oracle.com>

> ---
>  fs/xfs/libxfs/xfs_fs.h | 4 ----
>  fs/xfs/xfs_ioctl.c     | 3 +--
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h
> index 095bdf049a3f..a9aa13e66046 100644
> --- a/fs/xfs/libxfs/xfs_fs.h
> +++ b/fs/xfs/libxfs/xfs_fs.h
> @@ -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
>   */
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 6190697603c9..f6af76975bc8 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -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;
> -- 
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-05-09 15:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09  9:00 [PATCH] xfs: remove XFS_HSIZE Christoph Hellwig
2017-05-09 15:40 ` Darrick J. Wong [this message]
2017-05-11 15:43   ` Darrick J. Wong
2017-05-11 16:54     ` Christoph Hellwig
2017-05-09 15:40 ` Eric Sandeen
2017-05-09 21:18   ` Christoph Hellwig
2017-05-09 21:26     ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170509154000.GO5973@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).