public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, hch@infradead.org
Subject: Re: [PATCH 1/3] xfs: set ip->i_diflags directly in xfs_inode_inherit_flags
Date: Tue, 1 Jun 2021 09:33:15 +1000	[thread overview]
Message-ID: <20210531233315.GU664593@dread.disaster.area> (raw)
In-Reply-To: <162250083819.490289.18171121927859927558.stgit@locust>

On Mon, May 31, 2021 at 03:40:38PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Remove the unnecessary convenience variable.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  fs/xfs/xfs_inode.c |   25 +++++++++++--------------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index e4c2da4566f1..1e28997c6f78 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -689,47 +689,44 @@ xfs_inode_inherit_flags(
>  	struct xfs_inode	*ip,
>  	const struct xfs_inode	*pip)
>  {
> -	unsigned int		di_flags = 0;
>  	xfs_failaddr_t		failaddr;
>  	umode_t			mode = VFS_I(ip)->i_mode;
>  
>  	if (S_ISDIR(mode)) {
>  		if (pip->i_diflags & XFS_DIFLAG_RTINHERIT)
> -			di_flags |= XFS_DIFLAG_RTINHERIT;
> +			ip->i_diflags |= XFS_DIFLAG_RTINHERIT;
>  		if (pip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) {
> -			di_flags |= XFS_DIFLAG_EXTSZINHERIT;
> +			ip->i_diflags |= XFS_DIFLAG_EXTSZINHERIT;
>  			ip->i_extsize = pip->i_extsize;
>  		}

Hmmmm.

IIRC, these functions were originally written this way because the
compiler generated much better code using a local variable than when
writing directly to the ip->i_d.di_flags. Is this still true now?
I think it's worth checking, because we have changed the structure
of the xfs_inode (removed the i_d structure) so maybe this isn't a
concern anymore?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2021-05-31 23:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 22:40 [PATCHSET 0/3] xfs: various unit conversion Darrick J. Wong
2021-05-31 22:40 ` [PATCH 1/3] xfs: set ip->i_diflags directly in xfs_inode_inherit_flags Darrick J. Wong
2021-05-31 23:33   ` Dave Chinner [this message]
2021-06-01 10:43     ` Carlos Maiolino
2021-06-01 18:52     ` Darrick J. Wong
2021-05-31 22:40 ` [PATCH 2/3] xfs: clean up open-coded fs block unit conversions Darrick J. Wong
2021-05-31 23:33   ` Dave Chinner
2021-06-01 10:43   ` Carlos Maiolino
2021-05-31 22:40 ` [PATCH 3/3] xfs: remove unnecessary shifts Darrick J. Wong
2021-05-31 23:34   ` Dave Chinner
2021-06-01 10:44   ` Carlos Maiolino

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=20210531233315.GU664593@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --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