From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org, Brian Foster <bfoster@redhat.com>,
Chandan Rajendra <chandanrlinux@gmail.com>
Subject: Re: [PATCH 3/5] xfs: simplify di_flags2 inheritance in xfs_ialloc
Date: Wed, 18 Mar 2020 08:31:28 -0700 [thread overview]
Message-ID: <20200318153128.GZ256767@magnolia> (raw)
In-Reply-To: <20200317185756.1063268-4-hch@lst.de>
On Tue, Mar 17, 2020 at 07:57:54PM +0100, Christoph Hellwig wrote:
> di_flags2 is initialized to zero for v4 and earlier file systems. This
> means di_flags2 can only be non-zero for a v5 file systems, in which
> case both the parent and child inodes can store the field. Remove the
> extra di_version check, and also remove the rather pointless local
> di_flags2 variable while at it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
> Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_inode.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index d65d2509d5e0..dfb0a452a87d 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -907,20 +907,13 @@ xfs_ialloc(
>
> ip->i_d.di_flags |= di_flags;
> }
> - if (pip &&
> - (pip->i_d.di_flags2 & XFS_DIFLAG2_ANY) &&
> - pip->i_d.di_version == 3 &&
> - ip->i_d.di_version == 3) {
> - uint64_t di_flags2 = 0;
> -
> + if (pip && (pip->i_d.di_flags2 & XFS_DIFLAG2_ANY)) {
> if (pip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE) {
> - di_flags2 |= XFS_DIFLAG2_COWEXTSIZE;
> + ip->i_d.di_flags2 |= XFS_DIFLAG2_COWEXTSIZE;
> ip->i_d.di_cowextsize = pip->i_d.di_cowextsize;
> }
> if (pip->i_d.di_flags2 & XFS_DIFLAG2_DAX)
> - di_flags2 |= XFS_DIFLAG2_DAX;
> -
> - ip->i_d.di_flags2 |= di_flags2;
> + ip->i_d.di_flags2 |= XFS_DIFLAG2_DAX;
> }
> /* FALLTHROUGH */
> case S_IFLNK:
> --
> 2.24.1
>
next prev parent reply other threads:[~2020-03-18 15:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 18:57 remove the di_version icdinode field v3 Christoph Hellwig
2020-03-17 18:57 ` [PATCH 1/5] xfs: add a new xfs_sb_version_has_v3inode helper Christoph Hellwig
2020-03-18 9:59 ` Chandan Rajendra
2020-03-18 15:33 ` Darrick J. Wong
2020-03-18 16:17 ` Brian Foster
2020-03-17 18:57 ` [PATCH 2/5] xfs: only check the superblock version for dinode size calculation Christoph Hellwig
2020-03-18 15:32 ` Darrick J. Wong
2020-03-17 18:57 ` [PATCH 3/5] xfs: simplify di_flags2 inheritance in xfs_ialloc Christoph Hellwig
2020-03-18 15:31 ` Darrick J. Wong [this message]
2020-03-17 18:57 ` [PATCH 4/5] xfs: simplify a check in xfs_ioctl_setattr_check_cowextsize Christoph Hellwig
2020-03-18 15:30 ` Darrick J. Wong
2020-03-17 18:57 ` [PATCH 5/5] xfs: remove the di_version field from struct icdinode Christoph Hellwig
2020-03-18 15:29 ` Darrick J. Wong
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=20200318153128.GZ256767@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=chandanrlinux@gmail.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).