From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Allison Henderson <allison.henderson@oracle.com>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/7] xfs: clean up xfs_attr_node_hasname
Date: Fri, 20 May 2022 08:49:15 -0700 [thread overview]
Message-ID: <Yoe4ewF8H18Elzel@magnolia> (raw)
In-Reply-To: <20220520034210.GD1098723@dread.disaster.area>
On Fri, May 20, 2022 at 01:42:10PM +1000, Dave Chinner wrote:
> On Wed, May 18, 2022 at 11:55:49AM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > The calling conventions of this function are a mess -- callers /can/
> > provide a pointer to a pointer to a state structure, but it's not
> > required, and as evidenced by the last two patches, the callers that do
> > weren't be careful enough about how to deal with an existing da state.
> >
> > Push the allocation and freeing responsibilty to the callers, which
> > means that callers from the xattr node state machine steps now have the
> > visibility to allocate or free the da state structure as they please.
> > As a bonus, the node remove/add paths for larp-mode replaces can reset
> > the da state structure instead of freeing and immediately reallocating
> > it.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> > ---
> > fs/xfs/libxfs/xfs_attr.c | 63 +++++++++++++++++++++---------------------
> > fs/xfs/libxfs/xfs_da_btree.c | 11 +++++++
> > fs/xfs/libxfs/xfs_da_btree.h | 1 +
> > 3 files changed, 44 insertions(+), 31 deletions(-)
> >
> >
> > diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
> > index 576de34cfca0..3838109ef288 100644
> > --- a/fs/xfs/libxfs/xfs_attr.c
> > +++ b/fs/xfs/libxfs/xfs_attr.c
> > @@ -61,8 +61,8 @@ STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args);
> > static int xfs_attr_node_try_addname(struct xfs_attr_item *attr);
> > STATIC int xfs_attr_node_addname_find_attr(struct xfs_attr_item *attr);
> > STATIC int xfs_attr_node_remove_attr(struct xfs_attr_item *attr);
> > -STATIC int xfs_attr_node_hasname(xfs_da_args_t *args,
> > - struct xfs_da_state **state);
> > +STATIC int xfs_attr_node_lookup(struct xfs_da_args *args,
> > + struct xfs_da_state *state);
> >
> > int
> > xfs_inode_hasattr(
> > @@ -594,6 +594,19 @@ xfs_attr_leaf_mark_incomplete(
> > return xfs_attr3_leaf_setflag(args);
> > }
> >
> > +/* Ensure the da state of an xattr deferred work item is ready to go. */
> > +static inline void
> > +xfs_attr_item_ensure_da_state(
>
> xfs_attr_item_init_da_state().
>
> Other than that, it's a nice cleanup. I can rename the function
> locally if you want.
Yes, please. I don't have any further updates for this patch.
--D
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
>
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2022-05-20 15:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 18:55 [PATCHSET v2 0/7] xfs: cleanups for logged xattr updates Darrick J. Wong
2022-05-18 18:55 ` [PATCH 1/7] xfs: clean up xfs_attr_node_hasname Darrick J. Wong
2022-05-20 3:42 ` Dave Chinner
2022-05-20 15:49 ` Darrick J. Wong [this message]
2022-05-18 18:55 ` [PATCH 2/7] xfs: put the xattr intent item op flags in their own namespace Darrick J. Wong
2022-05-19 20:34 ` Alli
2022-05-20 3:42 ` Dave Chinner
2022-05-18 18:56 ` [PATCH 3/7] xfs: use a separate slab cache for deferred xattr work state Darrick J. Wong
2022-05-20 3:50 ` Dave Chinner
2022-05-18 18:56 ` [PATCH 4/7] xfs: remove struct xfs_attr_item.xattri_flags Darrick J. Wong
2022-05-20 4:07 ` Dave Chinner
2022-05-18 18:56 ` [PATCH 5/7] xfs: put attr[id] log item cache init with the others Darrick J. Wong
2022-05-20 4:08 ` Dave Chinner
2022-05-18 18:56 ` [PATCH 6/7] xfs: clean up state variable usage in xfs_attr_node_remove_attr Darrick J. Wong
2022-05-19 20:34 ` Alli
2022-05-20 4:09 ` Dave Chinner
2022-05-18 18:56 ` [PATCH 7/7] xfs: rename struct xfs_attr_item to xfs_attr_intent Darrick J. Wong
2022-05-20 4:10 ` 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=Yoe4ewF8H18Elzel@magnolia \
--to=djwong@kernel.org \
--cc=allison.henderson@oracle.com \
--cc=david@fromorbit.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