linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 12/24] xfs: remove xfs_bmapi_write() dfops param
Date: Thu, 28 Jun 2018 12:36:24 -0400	[thread overview]
Message-ID: <20180628163636.52564-13-bfoster@redhat.com> (raw)
In-Reply-To: <20180628163636.52564-1-bfoster@redhat.com>

Now that all callers use ->t_dfops, the xfs_bmapi_write() dfops
parameter is no longer necessary. Remove it and access ->t_dfops
directly. This patch does not change behavior.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/libxfs/xfs_attr_remote.c |  3 +--
 fs/xfs/libxfs/xfs_bmap.c        | 10 +++++-----
 fs/xfs/libxfs/xfs_bmap.h        |  3 +--
 fs/xfs/libxfs/xfs_da_btree.c    |  6 ++----
 fs/xfs/xfs_bmap_util.c          |  2 +-
 fs/xfs/xfs_dquot.c              |  2 +-
 fs/xfs/xfs_iomap.c              |  7 +++----
 fs/xfs/xfs_reflink.c            |  8 ++++----
 fs/xfs/xfs_rtalloc.c            |  2 +-
 fs/xfs/xfs_symlink.c            |  2 +-
 10 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index 577c4c372265..1f2bc86a28ed 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -484,8 +484,7 @@ xfs_attr_rmtval_set(
 		nmap = 1;
 		error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
 				  blkcnt, XFS_BMAPI_ATTRFORK, args->firstblock,
-				  args->total, &map, &nmap,
-				  args->trans->t_dfops);
+				  args->total, &map, &nmap);
 		if (error)
 			goto out_defer_cancel;
 		xfs_defer_ijoin(args->trans->t_dfops, dp);
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 93dbcf678e54..eabf9a151d6d 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -4246,8 +4246,7 @@ xfs_bmapi_write(
 						   controls a.g. for allocs */
 	xfs_extlen_t		total,		/* total blocks needed */
 	struct xfs_bmbt_irec	*mval,		/* output: map values */
-	int			*nmap,		/* i/o: mval size/count */
-	struct xfs_defer_ops	*dfops)		/* i/o: list extents to free */
+	int			*nmap)		/* i/o: mval size/count */
 {
 	struct xfs_mount	*mp = ip->i_mount;
 	struct xfs_ifork	*ifp;
@@ -4339,7 +4338,7 @@ xfs_bmapi_write(
 	bma.ip = ip;
 	bma.total = total;
 	bma.datatype = 0;
-	bma.dfops = dfops;
+	bma.dfops = tp ? tp->t_dfops : NULL;
 	bma.firstblock = firstblock;
 
 	while (bno < end && n < *nmap) {
@@ -4416,8 +4415,9 @@ xfs_bmapi_write(
 			 * the refcount btree for orphan recovery.
 			 */
 			if (whichfork == XFS_COW_FORK) {
-				error = xfs_refcount_alloc_cow_extent(mp, dfops,
-						bma.blkno, bma.length);
+				error = xfs_refcount_alloc_cow_extent(mp,
+						tp->t_dfops, bma.blkno,
+						bma.length);
 				if (error)
 					goto error0;
 			}
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
index 9b49ddf99c41..4bd7eeebb6d9 100644
--- a/fs/xfs/libxfs/xfs_bmap.h
+++ b/fs/xfs/libxfs/xfs_bmap.h
@@ -206,8 +206,7 @@ int	xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno,
 int	xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
 		xfs_fileoff_t bno, xfs_filblks_t len, int flags,
 		xfs_fsblock_t *firstblock, xfs_extlen_t total,
-		struct xfs_bmbt_irec *mval, int *nmap,
-		struct xfs_defer_ops *dfops);
+		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,
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
index d2048e4e93ec..e43f1dda02e4 100644
--- a/fs/xfs/libxfs/xfs_da_btree.c
+++ b/fs/xfs/libxfs/xfs_da_btree.c
@@ -2062,8 +2062,7 @@ xfs_da_grow_inode_int(
 	ASSERT(args->firstblock != NULL);
 	error = xfs_bmapi_write(tp, dp, *bno, count,
 			xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
-			args->firstblock, args->total, &map, &nmap,
-			args->trans->t_dfops);
+			args->firstblock, args->total, &map, &nmap);
 	if (error)
 		return error;
 
@@ -2086,8 +2085,7 @@ xfs_da_grow_inode_int(
 			error = xfs_bmapi_write(tp, dp, b, c,
 					xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
 					args->firstblock, args->total,
-					&mapp[mapi], &nmap,
-					args->trans->t_dfops);
+					&mapp[mapi], &nmap);
 			if (error)
 				goto out_free_map;
 			if (nmap < 1)
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index e6036f56241c..c40cb711447f 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -975,7 +975,7 @@ xfs_alloc_file_space(
 		tp->t_dfops = &dfops;
 		error = xfs_bmapi_write(tp, ip, startoffset_fsb,
 					allocatesize_fsb, alloc_type, &firstfsb,
-					resblks, imapp, &nimaps, tp->t_dfops);
+					resblks, imapp, &nimaps);
 		if (error)
 			goto error0;
 
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index aa62f8b17376..1ef38e1df679 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -313,7 +313,7 @@ xfs_dquot_disk_alloc(
 	error = xfs_bmapi_write(tp, quotip, dqp->q_fileoffset,
 			XFS_DQUOT_CLUSTER_SIZE_FSB, XFS_BMAPI_METADATA,
 			&firstblock, XFS_QM_DQALLOC_SPACE_RES(mp),
-			&map, &nmaps, tp->t_dfops);
+			&map, &nmaps);
 	if (error)
 		goto error0;
 	ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 8e1f3b451ee4..1b3177ee6896 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -259,7 +259,7 @@ xfs_iomap_write_direct(
 	nimaps = 1;
 	error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
 				bmapi_flags, &firstfsb, resblks, imap,
-				&nimaps, tp->t_dfops);
+				&nimaps);
 	if (error)
 		goto out_bmap_cancel;
 
@@ -773,8 +773,7 @@ xfs_iomap_write_allocate(
 			 */
 			error = xfs_bmapi_write(tp, ip, map_start_fsb,
 						count_fsb, flags, &first_block,
-						nres, imap, &nimaps,
-						tp->t_dfops);
+						nres, imap, &nimaps);
 			if (error)
 				goto trans_cancel;
 
@@ -884,7 +883,7 @@ xfs_iomap_write_unwritten(
 		nimaps = 1;
 		error = xfs_bmapi_write(tp, ip, offset_fsb, count_fsb,
 					XFS_BMAPI_CONVERT, &firstfsb, resblks,
-					&imap, &nimaps, tp->t_dfops);
+					&imap, &nimaps);
 		if (error)
 			goto error_on_bmapi_transaction;
 
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 1ff9ef1d65ba..3b2b8f5851c0 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -326,7 +326,7 @@ xfs_reflink_convert_cow_extent(
 		return 0;
 	return xfs_bmapi_write(NULL, ip, imap->br_startoff, imap->br_blockcount,
 			XFS_BMAPI_COWFORK | XFS_BMAPI_CONVERT, &first_block,
-			0, imap, &nimaps, NULL);
+			0, imap, &nimaps);
 }
 
 /* Convert all of the unwritten CoW extents in a file's range to real ones. */
@@ -349,8 +349,8 @@ xfs_reflink_convert_cow(
 	xfs_ilock(ip, XFS_ILOCK_EXCL);
 	error = xfs_bmapi_write(NULL, ip, offset_fsb, count_fsb,
 			XFS_BMAPI_COWFORK | XFS_BMAPI_CONVERT |
-			XFS_BMAPI_CONVERT_ONLY, &first_block, 0, &imap, &nimaps,
-			NULL);
+			XFS_BMAPI_CONVERT_ONLY, &first_block, 0, &imap,
+			&nimaps);
 	xfs_iunlock(ip, XFS_ILOCK_EXCL);
 	return error;
 }
@@ -435,7 +435,7 @@ xfs_reflink_allocate_cow(
 	/* Allocate the entire reservation as unwritten blocks. */
 	error = xfs_bmapi_write(tp, ip, imap->br_startoff, imap->br_blockcount,
 			XFS_BMAPI_COWFORK | XFS_BMAPI_PREALLOC, &first_block,
-			resblks, imap, &nimaps, tp->t_dfops);
+			resblks, imap, &nimaps);
 	if (error)
 		goto out_bmap_cancel;
 
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 312d410d91fb..1c7d1238ff3b 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -795,7 +795,7 @@ xfs_growfs_rt_alloc(
 		nmap = 1;
 		error = xfs_bmapi_write(tp, ip, oblocks, nblocks - oblocks,
 					XFS_BMAPI_METADATA, &firstblock,
-					resblks, &map, &nmap, tp->t_dfops);
+					resblks, &map, &nmap);
 		if (!error && nmap < 1)
 			error = -ENOSPC;
 		if (error)
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 6825a31727d1..2b6bcfd39c14 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -291,7 +291,7 @@ xfs_symlink(
 
 		error = xfs_bmapi_write(tp, ip, first_fsb, fs_blocks,
 				  XFS_BMAPI_METADATA, &first_block, resblks,
-				  mval, &nmaps, tp->t_dfops);
+				  mval, &nmaps);
 		if (error)
 			goto out_bmap_cancel;
 
-- 
2.17.1


  parent reply	other threads:[~2018-06-28 16:36 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 ` Brian Foster [this message]
2018-07-02 13:50   ` [PATCH 12/24] xfs: remove xfs_bmapi_write() dfops param 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
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=20180628163636.52564-13-bfoster@redhat.com \
    --to=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).