From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/7] xfs: remove XFS_IFBROOT
Date: Mon, 12 Apr 2021 12:03:42 -0400 [thread overview]
Message-ID: <YHRvXh+s1ksfbEjm@bfoster> (raw)
In-Reply-To: <20210412133819.2618857-6-hch@lst.de>
On Mon, Apr 12, 2021 at 03:38:17PM +0200, Christoph Hellwig wrote:
> Just check for a btree format fork instead of the using the equivalent
> in-memory XFS_IFBROOT flag.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/libxfs/xfs_bmap.c | 16 +++++++---------
> fs/xfs/libxfs/xfs_btree_staging.c | 1 -
> fs/xfs/libxfs/xfs_inode_fork.c | 4 +---
> fs/xfs/libxfs/xfs_inode_fork.h | 1 -
> 4 files changed, 8 insertions(+), 14 deletions(-)
>
...
> diff --git a/fs/xfs/libxfs/xfs_btree_staging.c b/fs/xfs/libxfs/xfs_btree_staging.c
> index f464a7c7cf2246..aa8dc9521c3942 100644
> --- a/fs/xfs/libxfs/xfs_btree_staging.c
> +++ b/fs/xfs/libxfs/xfs_btree_staging.c
> @@ -387,7 +387,6 @@ xfs_btree_bload_prep_block(
> new_size = bbl->iroot_size(cur, nr_this_block, priv);
> ifp->if_broot = kmem_zalloc(new_size, 0);
> ifp->if_broot_bytes = (int)new_size;
> - ifp->if_flags |= XFS_IFBROOT;
>
> /* Initialize it and send it out. */
> xfs_btree_init_block_int(cur->bc_mp, ifp->if_broot,
IIRC, these bits are used in xfsprogs for efficient btree repair. Taking
a closer look, I see AG metadata btree repair implementations, but
nothing that seems to use the ifake variant. Am I missing something or
is this code currently unused?
In any event, the comments for xfs_btree_stage_ifakeroot() suggest that
->if_format should be initialized properly when a fake inode fork is
transferred to a cursor and the rest of the patch looks fine to me:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
> index 73eea7939b55e4..02ad722004d3f4 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.c
> +++ b/fs/xfs/libxfs/xfs_inode_fork.c
> @@ -60,7 +60,7 @@ xfs_init_local_fork(
> }
>
> ifp->if_bytes = size;
> - ifp->if_flags &= ~(XFS_IFEXTENTS | XFS_IFBROOT);
> + ifp->if_flags &= ~XFS_IFEXTENTS;
> ifp->if_flags |= XFS_IFINLINE;
> }
>
> @@ -214,7 +214,6 @@ xfs_iformat_btree(
> xfs_bmdr_to_bmbt(ip, dfp, XFS_DFORK_SIZE(dip, ip->i_mount, whichfork),
> ifp->if_broot, size);
> ifp->if_flags &= ~XFS_IFEXTENTS;
> - ifp->if_flags |= XFS_IFBROOT;
>
> ifp->if_bytes = 0;
> ifp->if_u1.if_root = NULL;
> @@ -433,7 +432,6 @@ xfs_iroot_realloc(
> XFS_BMBT_BLOCK_LEN(ip->i_mount));
> } else {
> new_broot = NULL;
> - ifp->if_flags &= ~XFS_IFBROOT;
> }
>
> /*
> diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
> index 06682ff49a5bfc..8ffaa7cc1f7c3f 100644
> --- a/fs/xfs/libxfs/xfs_inode_fork.h
> +++ b/fs/xfs/libxfs/xfs_inode_fork.h
> @@ -32,7 +32,6 @@ struct xfs_ifork {
> */
> #define XFS_IFINLINE 0x01 /* Inline data is read in */
> #define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
> -#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */
>
> /*
> * Worst-case increase in the fork extent count when we're adding a single
> --
> 2.30.1
>
next prev parent reply other threads:[~2021-04-12 16:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 13:38 remove the if_flags field in struct xfs_ifork Christoph Hellwig
2021-04-12 13:38 ` [PATCH 1/7] xfs: move the XFS_IFEXTENTS check into xfs_iread_extents Christoph Hellwig
2021-04-13 23:21 ` Darrick J. Wong
2021-04-12 13:38 ` [PATCH 2/7] xfs: rename and simplify xfs_bmap_one_block Christoph Hellwig
2021-04-14 0:05 ` Darrick J. Wong
2021-04-12 13:38 ` [PATCH 3/7] xfs: simplify xfs_attr_remove_args Christoph Hellwig
2021-04-14 0:06 ` Darrick J. Wong
2021-04-12 13:38 ` [PATCH 4/7] xfs: only look at the fork format in xfs_idestroy_fork Christoph Hellwig
2021-04-14 0:08 ` Darrick J. Wong
2021-04-12 13:38 ` [PATCH 5/7] xfs: remove XFS_IFBROOT Christoph Hellwig
2021-04-12 16:03 ` Brian Foster [this message]
2021-04-14 15:23 ` Darrick J. Wong
2021-04-14 0:13 ` Darrick J. Wong
2021-04-12 13:38 ` [PATCH 6/7] xfs: remove XFS_IFINLINE Christoph Hellwig
2021-04-12 16:03 ` Brian Foster
2021-04-14 0:33 ` Darrick J. Wong
2021-04-12 13:38 ` [PATCH 7/7] xfs: remove XFS_IFEXTENTS Christoph Hellwig
2021-04-12 16:03 ` Brian Foster
2021-04-14 0:37 ` Darrick J. Wong
2021-04-14 5:59 ` Christoph Hellwig
2021-04-14 15:27 ` Darrick J. Wong
2021-04-14 15:29 ` Christoph Hellwig
2021-04-15 23:14 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2021-04-02 14:24 RFC: remove the if_flags field in struct xfs_ifork Christoph Hellwig
2021-04-02 14:24 ` [PATCH 5/7] xfs: remove XFS_IFBROOT Christoph Hellwig
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=YHRvXh+s1ksfbEjm@bfoster \
--to=bfoster@redhat.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).