linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 14/24] xfs: remove xfs_bunmapi() dfops param
Date: Tue, 3 Jul 2018 13:59:35 -0700	[thread overview]
Message-ID: <20180703205935.GJ32415@magnolia> (raw)
In-Reply-To: <20180628163636.52564-15-bfoster@redhat.com>

On Thu, Jun 28, 2018 at 12:36:26PM -0400, Brian Foster wrote:
> Now that all xfs_bunmapi() callers use ->t_dfops, remove the
> unnecessary parameter and access ->t_dfops directly. This patch does
> not change behavior.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/libxfs/xfs_attr_remote.c |  2 +-
>  fs/xfs/libxfs/xfs_bmap.c        | 20 +++++++++-----------
>  fs/xfs/libxfs/xfs_bmap.h        |  5 ++---
>  fs/xfs/libxfs/xfs_da_btree.c    |  2 +-
>  fs/xfs/libxfs/xfs_dir2.c        |  2 +-
>  fs/xfs/xfs_bmap_util.c          |  2 +-
>  fs/xfs/xfs_inode.c              |  2 +-
>  fs/xfs/xfs_reflink.c            |  5 ++---
>  fs/xfs/xfs_symlink.c            |  3 +--
>  9 files changed, 19 insertions(+), 24 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
> index 1f2bc86a28ed..179259fd1b5e 100644
> --- a/fs/xfs/libxfs/xfs_attr_remote.c
> +++ b/fs/xfs/libxfs/xfs_attr_remote.c
> @@ -629,7 +629,7 @@ xfs_attr_rmtval_remove(
>  		xfs_defer_init(args->trans->t_dfops, args->firstblock);
>  		error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
>  				    XFS_BMAPI_ATTRFORK, 1, args->firstblock,
> -				    args->trans->t_dfops, &done);
> +				    &done);
>  		if (error)
>  			goto out_defer_cancel;
>  		xfs_defer_ijoin(args->trans->t_dfops, args->dp);
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index eabf9a151d6d..25769e4f424c 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -5145,26 +5145,26 @@ xfs_bmap_del_extent_real(
>   */
>  int						/* error */
>  __xfs_bunmapi(
> -	xfs_trans_t		*tp,		/* transaction pointer */
> +	struct xfs_trans	*tp,		/* transaction pointer */
>  	struct xfs_inode	*ip,		/* incore inode */
>  	xfs_fileoff_t		start,		/* first file offset deleted */
>  	xfs_filblks_t		*rlen,		/* i/o: amount remaining */
>  	int			flags,		/* misc flags */
>  	xfs_extnum_t		nexts,		/* number of extents max */
> -	xfs_fsblock_t		*firstblock,	/* first allocated block
> +	xfs_fsblock_t		*firstblock)	/* first allocated block
>  						   controls a.g. for allocs */
> -	struct xfs_defer_ops	*dfops)		/* i/o: deferred updates */
>  {
> -	xfs_btree_cur_t		*cur;		/* bmap btree cursor */
> -	xfs_bmbt_irec_t		del;		/* extent being deleted */
> +	struct xfs_defer_ops	*dfops = tp ? tp->t_dfops : NULL;
> +	struct xfs_btree_cur	*cur;		/* bmap btree cursor */
> +	struct xfs_bmbt_irec	del;		/* extent being deleted */
>  	int			error;		/* error return value */
>  	xfs_extnum_t		extno;		/* extent number in list */
> -	xfs_bmbt_irec_t		got;		/* current extent record */
> +	struct xfs_bmbt_irec	got;		/* current extent record */
>  	xfs_ifork_t		*ifp;		/* inode fork pointer */
>  	int			isrt;		/* freeing in rt area */
>  	int			logflags;	/* transaction logging flags */
>  	xfs_extlen_t		mod;		/* rt extent offset */
> -	xfs_mount_t		*mp;		/* mount structure */
> +	struct xfs_mount	*mp;		/* mount structure */
>  	int			tmp_logflags;	/* partial logging flags */
>  	int			wasdel;		/* was a delayed alloc extent */
>  	int			whichfork;	/* data or attribute fork */
> @@ -5518,13 +5518,11 @@ xfs_bunmapi(
>  	int			flags,
>  	xfs_extnum_t		nexts,
>  	xfs_fsblock_t		*firstblock,
> -	struct xfs_defer_ops	*dfops,
>  	int			*done)
>  {
>  	int			error;
>  
> -	error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts, firstblock,
> -			dfops);
> +	error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts, firstblock);
>  	*done = (len == 0);
>  	return error;
>  }
> @@ -6195,7 +6193,7 @@ xfs_bmap_finish_one(
>  		break;
>  	case XFS_BMAP_UNMAP:
>  		error = __xfs_bunmapi(tp, ip, startoff, blockcount,
> -				XFS_BMAPI_REMAP, 1, &firstfsb, dfops);
> +				XFS_BMAPI_REMAP, 1, &firstfsb);
>  		break;
>  	default:
>  		ASSERT(0);
> diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
> index 4bd7eeebb6d9..4ff56f55f2bb 100644
> --- a/fs/xfs/libxfs/xfs_bmap.h
> +++ b/fs/xfs/libxfs/xfs_bmap.h
> @@ -209,12 +209,11 @@ int	xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
>  		struct xfs_bmbt_irec *mval, int *nmap);
>  int	__xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
>  		xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags,
> -		xfs_extnum_t nexts, xfs_fsblock_t *firstblock,
> -		struct xfs_defer_ops *dfops);
> +		xfs_extnum_t nexts, xfs_fsblock_t *firstblock);
>  int	xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
>  		xfs_fileoff_t bno, xfs_filblks_t len, int flags,
>  		xfs_extnum_t nexts, xfs_fsblock_t *firstblock,
> -		struct xfs_defer_ops *dfops, int *done);
> +		int *done);
>  int	xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
>  		struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got,
>  		struct xfs_bmbt_irec *del);
> diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
> index e43f1dda02e4..68a72e3d9f53 100644
> --- a/fs/xfs/libxfs/xfs_da_btree.c
> +++ b/fs/xfs/libxfs/xfs_da_btree.c
> @@ -2395,7 +2395,7 @@ xfs_da_shrink_inode(
>  		 */
>  		error = xfs_bunmapi(tp, dp, dead_blkno, count,
>  				    xfs_bmapi_aflag(w), 0, args->firstblock,
> -				    args->trans->t_dfops, &done);
> +				    &done);
>  		if (error == -ENOSPC) {
>  			if (w != XFS_DATA_FORK)
>  				break;
> diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c
> index ffa288c37da0..26918c5bd819 100644
> --- a/fs/xfs/libxfs/xfs_dir2.c
> +++ b/fs/xfs/libxfs/xfs_dir2.c
> @@ -663,7 +663,7 @@ xfs_dir2_shrink_inode(
>  
>  	/* Unmap the fsblock(s). */
>  	error = xfs_bunmapi(tp, dp, da, args->geo->fsbcount, 0, 0,
> -			    args->firstblock, args->trans->t_dfops, &done);
> +			    args->firstblock, &done);
>  	if (error) {
>  		/*
>  		 * ENOSPC actually can happen if we're in a removename with no
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 78189cf385f2..58b51648240d 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -1045,7 +1045,7 @@ xfs_unmap_extent(
>  	xfs_defer_init(&dfops, &firstfsb);
>  	tp->t_dfops = &dfops;
>  	error = xfs_bunmapi(tp, ip, startoffset_fsb, len_fsb, 0, 2, &firstfsb,
> -			tp->t_dfops, done);
> +			    done);
>  	if (error)
>  		goto out_bmap_cancel;
>  
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 539d96201666..f456df2e1394 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -1588,7 +1588,7 @@ xfs_itruncate_extents_flags(
>  		tp->t_dfops = &dfops;
>  		error = xfs_bunmapi(tp, ip, first_unmap_block, unmap_len, flags,
>  				    XFS_ITRUNC_MAX_EXTENTS, &first_block,
> -				    tp->t_dfops, &done);
> +				    &done);
>  		if (error)
>  			goto out_bmap_cancel;
>  
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index bb22a17fbca8..2221c6c6a5d3 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -766,7 +766,7 @@ xfs_reflink_end_cow(
>  		tp->t_dfops = &dfops;
>  		rlen = del.br_blockcount;
>  		error = __xfs_bunmapi(tp, ip, del.br_startoff, &rlen, 0, 1,
> -				&firstfsb, tp->t_dfops);
> +				&firstfsb);
>  		if (error)
>  			goto out_defer;
>  
> @@ -1115,8 +1115,7 @@ xfs_reflink_remap_extent(
>  	while (rlen) {
>  		xfs_defer_init(&dfops, &firstfsb);
>  		tp->t_dfops = &dfops;
> -		error = __xfs_bunmapi(tp, ip, destoff, &rlen, 0, 1,
> -				&firstfsb, tp->t_dfops);
> +		error = __xfs_bunmapi(tp, ip, destoff, &rlen, 0, 1, &firstfsb);
>  		if (error)
>  			goto out_defer;
>  
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index 290ae13d4673..a54f095c1409 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -466,8 +466,7 @@ xfs_inactive_symlink_rmt(
>  	/*
>  	 * Unmap the dead block(s) to the dfops.
>  	 */
> -	error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps,
> -			    &first_block, tp->t_dfops, &done);
> +	error = xfs_bunmapi(tp, ip, 0, size, 0, nmaps, &first_block, &done);
>  	if (error)
>  		goto error_bmap_cancel;
>  	ASSERT(done);
> -- 
> 2.17.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-07-03 20:59 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28 16:36 [PATCH 00/24] xfs: broad enablement of deferred agfl frees Brian Foster
2018-06-28 16:36 ` [PATCH 01/24] xfs: cow unwritten conversion uses uninitialized dfops Brian Foster
2018-07-02 13:43   ` Christoph Hellwig
2018-07-02 17:32     ` Brian Foster
2018-07-03 14:59       ` Darrick J. Wong
2018-07-03 15:10         ` Brian Foster
2018-07-03 15:21           ` Darrick J. Wong
2018-07-03 16:14             ` Brian Foster
2018-07-03 16:35               ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 02/24] xfs: rename xfs_trans ->t_agfl_dfops to ->t_dfops Brian Foster
2018-07-02 13:43   ` Christoph Hellwig
2018-07-03 15:36   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 03/24] xfs: remove dfops parameter from ifree call stack Brian Foster
2018-07-02 13:43   ` Christoph Hellwig
2018-07-03 15:36   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 04/24] xfs: remove dfops param from high level dirname calls Brian Foster
2018-07-02 13:45   ` Christoph Hellwig
2018-07-02 17:32     ` Brian Foster
2018-07-02 17:37   ` [PATCH v2] " Brian Foster
2018-07-03 15:19     ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 05/24] xfs: use ->t_dfops for recovery of [b|c]ui log items Brian Foster
2018-07-02 13:45   ` Christoph Hellwig
2018-07-02 17:33     ` Brian Foster
2018-07-02 17:38   ` [PATCH v2] " Brian Foster
2018-07-03 15:15     ` Darrick J. Wong
2018-07-03 16:11       ` Brian Foster
2018-07-03 16:17         ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 06/24] xfs: use ->t_dfops for attr set/remove operations Brian Foster
2018-07-02 13:46   ` Christoph Hellwig
2018-07-03 20:26   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 07/24] xfs: remove dfops param in attr fork add path Brian Foster
2018-07-02 13:47   ` Christoph Hellwig
2018-07-03 20:27   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 08/24] xfs: use ->t_dfops in extent split tx and remove param Brian Foster
2018-07-02 13:48   ` Christoph Hellwig
2018-07-03 20:30   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 09/24] xfs: replace xfs_da_args->dfops accesses with ->t_dfops and remove Brian Foster
2018-07-02 13:48   ` Christoph Hellwig
2018-07-03 20:38   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 10/24] xfs: use ->t_dfops in dqalloc transaction Brian Foster
2018-07-02 13:49   ` Christoph Hellwig
2018-07-03 19:59   ` Darrick J. Wong
2018-07-03 20:47     ` Brian Foster
2018-06-28 16:36 ` [PATCH 11/24] xfs: use ->t_dfops for all xfs_bmapi_write() callers Brian Foster
2018-07-02 13:49   ` Christoph Hellwig
2018-07-03 20:42   ` Darrick J. Wong
2018-07-03 20:48     ` Brian Foster
2018-06-28 16:36 ` [PATCH 12/24] xfs: remove xfs_bmapi_write() dfops param Brian Foster
2018-07-02 13:50   ` Christoph Hellwig
2018-07-03 20:43   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 13/24] xfs: use ->t_dfops for all xfs_bunmapi() callers Brian Foster
2018-07-02 13:51   ` Christoph Hellwig
2018-07-03 20:55   ` Darrick J. Wong
2018-07-03 21:16     ` Brian Foster
2018-06-28 16:36 ` [PATCH 14/24] xfs: remove xfs_bunmapi() dfops param Brian Foster
2018-07-02 13:52   ` Christoph Hellwig
2018-07-03 20:59   ` Darrick J. Wong [this message]
2018-06-28 16:36 ` [PATCH 15/24] xfs: remove xfs_bmapi_remap() " Brian Foster
2018-07-02 13:52   ` Christoph Hellwig
2018-07-03 21:02   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 16/24] xfs: remove struct xfs_bmalloca dfops field Brian Foster
2018-07-02 13:52   ` Christoph Hellwig
2018-07-03 21:02   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 17/24] xfs: use ->t_dfops for collapse/insert range operations Brian Foster
2018-07-02 13:53   ` Christoph Hellwig
2018-07-03 21:03   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 18/24] xfs: remove dfops param from internal bmap extent helpers Brian Foster
2018-07-02 13:53   ` Christoph Hellwig
2018-07-03 21:07   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 19/24] xfs: remove xfs_btree_cur bmbt dfops field Brian Foster
2018-07-02 13:53   ` Christoph Hellwig
2018-07-03 21:07   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 20/24] xfs: remove unused btree cursor bc_private.a.dfops field Brian Foster
2018-07-02 13:54   ` Christoph Hellwig
2018-07-03 21:09   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 21/24] xfs: use ->t_dfops for rmap extent swap operations Brian Foster
2018-07-02 13:54   ` Christoph Hellwig
2018-07-03 21:22   ` Darrick J. Wong
2018-07-03 21:56     ` Brian Foster
2018-06-28 16:36 ` [PATCH 22/24] xfs: use ->t_dfops in cancel cow blocks operation Brian Foster
2018-07-02 13:55   ` Christoph Hellwig
2018-07-03 21:25   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 23/24] xfs: use ->t_dfops in reflink cow recover path Brian Foster
2018-07-02 13:55   ` Christoph Hellwig
2018-07-03 21:25   ` Darrick J. Wong
2018-06-28 16:36 ` [PATCH 24/24] xfs: refactor dfops init to attach to transaction Brian Foster
2018-07-02 13:55   ` Christoph Hellwig
2018-07-03 21:26   ` Darrick J. Wong
2018-07-02 14:51 ` [PATCH 00/24] xfs: broad enablement of deferred agfl frees Christoph Hellwig
2018-07-02 17:40   ` Brian Foster

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=20180703205935.GJ32415@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@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;
as well as URLs for NNTP newsgroup(s).