All of lore.kernel.org
 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 v2 13/15] xfs: pass transaction to xfs_defer_add()
Date: Wed, 1 Aug 2018 12:10:25 -0700	[thread overview]
Message-ID: <20180801191025.GI30972@magnolia> (raw)
In-Reply-To: <20180801131952.60250-14-bfoster@redhat.com>

On Wed, Aug 01, 2018 at 09:19:50AM -0400, Brian Foster wrote:
> The majority of remaining references to struct xfs_defer_ops in XFS
> are associated with xfs_defer_add(). At this point, there are no
> more external xfs_defer_ops users left. All instances of
> xfs_defer_ops are embedded in the transaction, which means we can
> safely pass the transaction down to the dfops add interface.
> 
> Update xfs_defer_add() to receive the transaction as a parameter.
> Various subsystems implement wrappers to allocate and construct the
> context specific data structures for the associated deferred
> operation type. Update these to also carry the transaction down as
> needed and clean up unused dfops parameters along the way.
> 
> This removes most of the remaining references to struct
> xfs_defer_ops throughout the code and facilitates removal of the
> structure.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>

FWIW I've made the following edits to this patch to get rid of the
compiler warnings in xfsprogs and with CONFIG_FTRACE=n because our
tracepoints don't do anything with the *mp local variable.  There aren't
any functional changes.

--D

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index f5f1fc47923e..c9fec0443f38 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -539,11 +539,11 @@ __xfs_bmap_add_free(
 	struct xfs_owner_info		*oinfo,
 	bool				skip_discard)
 {
-	struct xfs_mount		*mp = tp->t_mountp;
 	struct xfs_extent_free_item	*new;		/* new element */
 #ifdef DEBUG
-	xfs_agnumber_t		agno;
-	xfs_agblock_t		agbno;
+	struct xfs_mount		*mp = tp->t_mountp;
+	xfs_agnumber_t			agno;
+	xfs_agblock_t			agbno;
 
 	ASSERT(bno != NULLFSBLOCK);
 	ASSERT(len > 0);
@@ -566,8 +566,9 @@ __xfs_bmap_add_free(
 	else
 		xfs_rmap_skip_owner_update(&new->xefi_oinfo);
 	new->xefi_skip_discard = skip_discard;
-	trace_xfs_bmap_free_defer(mp, XFS_FSB_TO_AGNO(mp, bno), 0,
-			XFS_FSB_TO_AGBNO(mp, bno), len);
+	trace_xfs_bmap_free_defer(tp->t_mountp,
+			XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0,
+			XFS_FSB_TO_AGBNO(tp->t_mountp, bno), len);
 	xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_FREE, &new->xefi_list);
 }
 
@@ -5980,13 +5981,12 @@ __xfs_bmap_add(
 	int				whichfork,
 	struct xfs_bmbt_irec		*bmap)
 {
-	struct xfs_mount		*mp = tp->t_mountp;
 	struct xfs_bmap_intent		*bi;
 
-	trace_xfs_bmap_defer(mp,
-			XFS_FSB_TO_AGNO(mp, bmap->br_startblock),
+	trace_xfs_bmap_defer(tp->t_mountp,
+			XFS_FSB_TO_AGNO(tp->t_mountp, bmap->br_startblock),
 			type,
-			XFS_FSB_TO_AGBNO(mp, bmap->br_startblock),
+			XFS_FSB_TO_AGBNO(tp->t_mountp, bmap->br_startblock),
 			ip->i_ino, whichfork,
 			bmap->br_startoff,
 			bmap->br_blockcount,
diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c
index c713c49200d3..542aa1475b5f 100644
--- a/fs/xfs/libxfs/xfs_refcount.c
+++ b/fs/xfs/libxfs/xfs_refcount.c
@@ -1183,11 +1183,11 @@ __xfs_refcount_add(
 	xfs_fsblock_t			startblock,
 	xfs_extlen_t			blockcount)
 {
-	struct xfs_mount		*mp = tp->t_mountp;
 	struct xfs_refcount_intent	*ri;
 
-	trace_xfs_refcount_defer(mp, XFS_FSB_TO_AGNO(mp, startblock),
-			type, XFS_FSB_TO_AGBNO(mp, startblock),
+	trace_xfs_refcount_defer(tp->t_mountp,
+			XFS_FSB_TO_AGNO(tp->t_mountp, startblock),
+			type, XFS_FSB_TO_AGBNO(tp->t_mountp, startblock),
 			blockcount);
 
 	ri = kmem_alloc(sizeof(struct xfs_refcount_intent),
diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
index aa683eda6b70..245af452840e 100644
--- a/fs/xfs/libxfs/xfs_rmap.c
+++ b/fs/xfs/libxfs/xfs_rmap.c
@@ -2283,12 +2283,12 @@ __xfs_rmap_add(
 	int				whichfork,
 	struct xfs_bmbt_irec		*bmap)
 {
-	struct xfs_mount		*mp = tp->t_mountp;
 	struct xfs_rmap_intent		*ri;
 
-	trace_xfs_rmap_defer(mp, XFS_FSB_TO_AGNO(mp, bmap->br_startblock),
+	trace_xfs_rmap_defer(tp->t_mountp,
+			XFS_FSB_TO_AGNO(tp->t_mountp, bmap->br_startblock),
 			type,
-			XFS_FSB_TO_AGBNO(mp, bmap->br_startblock),
+			XFS_FSB_TO_AGBNO(tp->t_mountp, bmap->br_startblock),
 			owner, whichfork,
 			bmap->br_startoff,
 			bmap->br_blockcount,

  reply	other threads:[~2018-08-01 20:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 13:19 [PATCH v2 00/15] xfs: condense dfops and automatic relogging Brian Foster
2018-08-01 13:19 ` [PATCH v2 01/15] xfs: refactor internal dfops initialization Brian Foster
2018-08-01 14:34   ` Darrick J. Wong
2018-08-01 13:19 ` [PATCH v2 02/15] xfs: use transaction for intent recovery instead of raw dfops Brian Foster
2018-08-01 14:35   ` Darrick J. Wong
2018-08-01 13:19 ` [PATCH v2 03/15] xfs: remove unused __xfs_defer_cancel() internal helper Brian Foster
2018-08-01 13:19 ` [PATCH v2 04/15] xfs: pass transaction to dfops reset/move helpers Brian Foster
2018-08-01 13:19 ` [PATCH v2 05/15] xfs: replace dop_low with transaction flag Brian Foster
2018-08-01 13:19 ` [PATCH v2 06/15] xfs: add missing defer ijoins for held inodes Brian Foster
2018-08-01 13:19 ` [PATCH v2 07/15] xfs: automatic dfops buffer relogging Brian Foster
2018-08-01 14:35   ` Darrick J. Wong
2018-08-01 13:19 ` [PATCH v2 08/15] xfs: automatic dfops inode relogging Brian Foster
2018-08-01 14:36   ` Darrick J. Wong
2018-08-01 13:19 ` [PATCH v2 09/15] xfs: drop dop param from xfs_defer_op_type ->finish_item() callback Brian Foster
2018-08-01 13:19 ` [PATCH v2 10/15] xfs: clean out superfluous dfops dop params/vars Brian Foster
2018-08-01 19:12   ` Darrick J. Wong
2018-08-01 13:19 ` [PATCH v2 11/15] xfs: cancel dfops on xfs_defer_finish() error Brian Foster
2018-08-01 13:19 ` [PATCH v2 12/15] xfs: replace xfs_defer_ops ->dop_pending with on-stack list Brian Foster
2018-08-01 14:39   ` Darrick J. Wong
2018-08-02  9:29   ` Christoph Hellwig
2018-08-02 12:09     ` Brian Foster
2018-08-02 12:10   ` [PATCH v3 " Brian Foster
2018-08-01 13:19 ` [PATCH v2 13/15] xfs: pass transaction to xfs_defer_add() Brian Foster
2018-08-01 19:10   ` Darrick J. Wong [this message]
2018-08-01 13:19 ` [PATCH v2 14/15] xfs: always defer agfl block frees Brian Foster
2018-08-01 13:19 ` [PATCH v2 15/15] xfs: fold dfops into the transaction Brian Foster
2018-08-02 12:11   ` [PATCH v3 " 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=20180801191025.GI30972@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.