public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Chandan Babu R <chandan.babu@oracle.com>,
	"open list:XFS FILESYSTEM" <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/5] xfs: move xfs_attr_defer_type up in xfs_attr_item.c
Date: Wed, 13 Dec 2023 10:10:42 -0800	[thread overview]
Message-ID: <20231213181042.GE361584@frogsfrogsfrogs> (raw)
In-Reply-To: <20231213090633.231707-3-hch@lst.de>

On Wed, Dec 13, 2023 at 10:06:30AM +0100, Christoph Hellwig wrote:
> We'll reference it directly in xlog_recover_attri_commit_pass2, so move
> it up a bit.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_attr_item.c | 66 +++++++++++++++++++++---------------------
>  1 file changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
> index 39f2c5a46179f7..4e0eaa2640e0d2 100644
> --- a/fs/xfs/xfs_attr_item.c
> +++ b/fs/xfs/xfs_attr_item.c
> @@ -654,6 +654,39 @@ xfs_attr_relog_intent(
>  	return &new_attrip->attri_item;
>  }
>  
> +/* Get an ATTRD so we can process all the attrs. */
> +static struct xfs_log_item *
> +xfs_attr_create_done(
> +	struct xfs_trans		*tp,
> +	struct xfs_log_item		*intent,
> +	unsigned int			count)
> +{
> +	struct xfs_attri_log_item	*attrip;
> +	struct xfs_attrd_log_item	*attrdp;
> +
> +	attrip = ATTRI_ITEM(intent);
> +
> +	attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_NOFS | __GFP_NOFAIL);
> +
> +	xfs_log_item_init(tp->t_mountp, &attrdp->attrd_item, XFS_LI_ATTRD,
> +			  &xfs_attrd_item_ops);
> +	attrdp->attrd_attrip = attrip;
> +	attrdp->attrd_format.alfd_alf_id = attrip->attri_format.alfi_id;
> +
> +	return &attrdp->attrd_item;
> +}
> +
> +const struct xfs_defer_op_type xfs_attr_defer_type = {
> +	.max_items	= 1,
> +	.create_intent	= xfs_attr_create_intent,
> +	.abort_intent	= xfs_attr_abort_intent,
> +	.create_done	= xfs_attr_create_done,
> +	.finish_item	= xfs_attr_finish_item,
> +	.cancel_item	= xfs_attr_cancel_item,
> +	.recover_work	= xfs_attr_recover_work,
> +	.relog_intent	= xfs_attr_relog_intent,
> +};
> +
>  STATIC int
>  xlog_recover_attri_commit_pass2(
>  	struct xlog                     *log,
> @@ -730,39 +763,6 @@ xlog_recover_attri_commit_pass2(
>  	return 0;
>  }
>  
> -/* Get an ATTRD so we can process all the attrs. */
> -static struct xfs_log_item *
> -xfs_attr_create_done(
> -	struct xfs_trans		*tp,
> -	struct xfs_log_item		*intent,
> -	unsigned int			count)
> -{
> -	struct xfs_attri_log_item	*attrip;
> -	struct xfs_attrd_log_item	*attrdp;
> -
> -	attrip = ATTRI_ITEM(intent);
> -
> -	attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_NOFS | __GFP_NOFAIL);
> -
> -	xfs_log_item_init(tp->t_mountp, &attrdp->attrd_item, XFS_LI_ATTRD,
> -			  &xfs_attrd_item_ops);
> -	attrdp->attrd_attrip = attrip;
> -	attrdp->attrd_format.alfd_alf_id = attrip->attri_format.alfi_id;
> -
> -	return &attrdp->attrd_item;
> -}
> -
> -const struct xfs_defer_op_type xfs_attr_defer_type = {
> -	.max_items	= 1,
> -	.create_intent	= xfs_attr_create_intent,
> -	.abort_intent	= xfs_attr_abort_intent,
> -	.create_done	= xfs_attr_create_done,
> -	.finish_item	= xfs_attr_finish_item,
> -	.cancel_item	= xfs_attr_cancel_item,
> -	.recover_work	= xfs_attr_recover_work,
> -	.relog_intent	= xfs_attr_relog_intent,
> -};
> -
>  /*
>   * This routine is called when an ATTRD format structure is found in a committed
>   * transaction in the log. Its purpose is to cancel the corresponding ATTRI if
> -- 
> 2.39.2
> 
> 

  reply	other threads:[~2023-12-13 18:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  9:06 pass ops directly to the xfs_defer helpers Christoph Hellwig
2023-12-13  9:06 ` [PATCH 1/5] xfs: consolidate the xfs_attr_defer_* helpers Christoph Hellwig
2023-12-13 18:10   ` Darrick J. Wong
2023-12-13  9:06 ` [PATCH 2/5] xfs: move xfs_attr_defer_type up in xfs_attr_item.c Christoph Hellwig
2023-12-13 18:10   ` Darrick J. Wong [this message]
2023-12-13  9:06 ` [PATCH 3/5] xfs: store an ops pointer in struct xfs_defer_pending Christoph Hellwig
2023-12-13 18:14   ` Darrick J. Wong
2023-12-13  9:06 ` [PATCH 4/5] xfs: pass the defer ops instead of type to xfs_defer_start_recovery Christoph Hellwig
2023-12-13 18:15   ` Darrick J. Wong
2023-12-14  5:16   ` [PATCH 4/5 v1.1] " Christoph Hellwig
2023-12-14 17:20     ` Darrick J. Wong
2023-12-13  9:06 ` [PATCH 5/5] xfs: pass the defer ops directly to xfs_defer_add Christoph Hellwig
2023-12-13 18:16   ` 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=20231213181042.GE361584@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=chandan.babu@oracle.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