From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org, david@fromorbit.com,
Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH 6/7] xfs: make the btree cursor union members named structure
Date: Thu, 12 Mar 2020 16:44:18 -0700 [thread overview]
Message-ID: <20200312234418.GR8045@magnolia> (raw)
In-Reply-To: <20200312104929.GF60753@bfoster>
On Thu, Mar 12, 2020 at 06:49:29AM -0400, Brian Foster wrote:
> On Wed, Mar 11, 2020 at 08:45:20PM -0700, Darrick J. Wong wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > we need to name the btree cursor private structures to be able
> > to pull them out of the deeply nested structure definition they are
> > in now.
> >
> > Based on code extracted from a patchset by Darrick Wong.
> >
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > fs/xfs/libxfs/xfs_btree.h | 36 +++++++++++++++++++++---------------
> > 1 file changed, 21 insertions(+), 15 deletions(-)
> >
> >
> > diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
> > index 12a2bc93371d..9884f543eb51 100644
> > --- a/fs/xfs/libxfs/xfs_btree.h
> > +++ b/fs/xfs/libxfs/xfs_btree.h
> > @@ -188,6 +188,24 @@ union xfs_btree_cur_private {
> > } abt;
> > };
> >
> > +/* Per-AG btree information. */
> > +struct xfs_btree_cur_ag {
> > + struct xfs_buf *agbp;
> > + xfs_agnumber_t agno;
> > + union xfs_btree_cur_private priv;
> > +};
> > +
> > +/* Btree-in-inode cursor information */
> > +struct xfs_btree_cur_ino {
> > + struct xfs_inode *ip;
> > + int allocated;
> > + short forksize;
> > + char whichfork;
> > + char flags;
> > +#define XFS_BTCUR_BMBT_WASDEL (1 << 0)
> > +#define XFS_BTCUR_BMBT_INVALID_OWNER (1 << 1)
> > +};
> > +
>
> Are all of the per-field comments dropped intentionally? These are
> mostly self-explanatory, so either way:
I think the comments were not that valuable, and that I can perhaps
improve them:
/* We are converting a delalloc reservation */
#define XFS_BTCUR_BMBT_WASDEL (1 << 0)
/* For extent swap, ignore owner check in verifier */
#define XFS_BTCUR_BMBT_INVALID_OWNER (1 << 1)
Anyway, thanks for reviewing this series.
--D
> Reviewed-by: Brian Foster <bfoster@redhat.com>
>
> > /*
> > * Btree cursor structure.
> > * This collects all information needed by the btree code in one place.
> > @@ -209,21 +227,9 @@ typedef struct xfs_btree_cur
> > xfs_btnum_t bc_btnum; /* identifies which btree type */
> > int bc_statoff; /* offset of btre stats array */
> > union {
> > - struct { /* needed for BNO, CNT, INO */
> > - struct xfs_buf *agbp; /* agf/agi buffer pointer */
> > - xfs_agnumber_t agno; /* ag number */
> > - union xfs_btree_cur_private priv;
> > - } bc_ag;
> > - struct { /* needed for BMAP */
> > - struct xfs_inode *ip; /* pointer to our inode */
> > - int allocated; /* count of alloced */
> > - short forksize; /* fork's inode space */
> > - char whichfork; /* data or attr fork */
> > - char flags; /* flags */
> > -#define XFS_BTCUR_BMBT_WASDEL (1 << 0) /* was delayed */
> > -#define XFS_BTCUR_BMBT_INVALID_OWNER (1 << 1) /* for ext swap */
> > - } bc_ino;
> > - }; /* per-btree type data */
> > + struct xfs_btree_cur_ag bc_ag;
> > + struct xfs_btree_cur_ino bc_ino;
> > + };
> > } xfs_btree_cur_t;
> >
> > /* cursor flags */
> >
>
next prev parent reply other threads:[~2020-03-12 23:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-12 3:44 [PATCH v2 0/7] xfs: make btree cursor private unions anonymous Darrick J. Wong
2020-03-12 3:44 ` [PATCH 1/7] xfs: introduce new private btree cursor names Darrick J. Wong
2020-03-12 10:41 ` Brian Foster
2020-03-12 3:44 ` [PATCH 2/7] xfs: convert btree cursor ag-private member name Darrick J. Wong
2020-03-12 10:42 ` Brian Foster
2020-03-12 3:45 ` [PATCH 3/7] xfs: convert btree cursor inode-private member names Darrick J. Wong
2020-03-12 10:42 ` Brian Foster
2020-03-12 3:45 ` [PATCH 4/7] xfs: rename btree cursor private btree member flags Darrick J. Wong
2020-03-12 10:42 ` Brian Foster
2020-03-12 3:45 ` [PATCH 5/7] xfs: make btree cursor private union anonymous Darrick J. Wong
2020-03-12 10:49 ` Brian Foster
2020-03-12 3:45 ` [PATCH 6/7] xfs: make the btree cursor union members named structure Darrick J. Wong
2020-03-12 10:49 ` Brian Foster
2020-03-12 23:44 ` Darrick J. Wong [this message]
2020-03-13 4:32 ` Dave Chinner
2020-03-12 3:45 ` [PATCH 7/7] xfs: make the btree ag cursor private union anonymous Darrick J. Wong
2020-03-12 10:49 ` Brian Foster
-- strict thread matches above, loose matches on Subject: below --
2020-03-05 1:45 [PATCH 0/7] xfs: make btree cursor private unions anonymous Dave Chinner
2020-03-05 1:45 ` [PATCH 6/7] xfs: make the btree cursor union members named structure Dave Chinner
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=20200312234418.GR8045@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--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