From: "Darrick J. Wong" <djwong@kernel.org>
To: aalbersh@kernel.org, djwong@kernel.org, cem@kernel.org
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: [PATCH 48/64] xfs: move xfs_rmap_update_defer_add to xfs_rmap_item.c
Date: Tue, 01 Oct 2024 18:20:19 -0700 [thread overview]
Message-ID: <172783102505.4036371.11209477625800698380.stgit@frogsfrogsfrogs> (raw)
In-Reply-To: <172783101710.4036371.10020616537589726441.stgit@frogsfrogsfrogs>
From: Darrick J. Wong <djwong@kernel.org>
Source kernel commit: ea7b0820d960d5a3ee72bc67cbd8b5d47c67aa4c
Move the code that adds the incore xfs_rmap_update_item deferred work
data to a transaction to live with the RUI log item code. This means
that the rmap code no longer has to know about the inner workings of the
RUI log items.
As a consequence, we can get rid of the _{get,put}_group helpers.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
libxfs/defer_item.c | 21 +++++++++------------
libxfs/defer_item.h | 4 ++++
libxfs/xfs_rmap.c | 6 ++----
libxfs/xfs_rmap.h | 3 ---
4 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/libxfs/defer_item.c b/libxfs/defer_item.c
index 7721267e4..1c106b844 100644
--- a/libxfs/defer_item.c
+++ b/libxfs/defer_item.c
@@ -243,21 +243,18 @@ xfs_rmap_update_create_done(
return NULL;
}
-/* Take an active ref to the AG containing the space we're rmapping. */
+/* Add this deferred RUI to the transaction. */
void
-xfs_rmap_update_get_group(
- struct xfs_mount *mp,
+xfs_rmap_defer_add(
+ struct xfs_trans *tp,
struct xfs_rmap_intent *ri)
{
+ struct xfs_mount *mp = tp->t_mountp;
+
+ trace_xfs_rmap_defer(mp, ri);
+
ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_bmap.br_startblock);
-}
-
-/* Release an active AG ref after finishing rmapping work. */
-static inline void
-xfs_rmap_update_put_group(
- struct xfs_rmap_intent *ri)
-{
- xfs_perag_intent_put(ri->ri_pag);
+ xfs_defer_add(tp, &ri->ri_list, &xfs_rmap_update_defer_type);
}
/* Cancel a deferred rmap update. */
@@ -267,7 +264,7 @@ xfs_rmap_update_cancel_item(
{
struct xfs_rmap_intent *ri = ri_entry(item);
- xfs_rmap_update_put_group(ri);
+ xfs_perag_intent_put(ri->ri_pag);
kmem_cache_free(xfs_rmap_intent_cache, ri);
}
diff --git a/libxfs/defer_item.h b/libxfs/defer_item.h
index 03f3f1505..be354785b 100644
--- a/libxfs/defer_item.h
+++ b/libxfs/defer_item.h
@@ -30,4 +30,8 @@ void xfs_extent_free_defer_add(struct xfs_trans *tp,
struct xfs_extent_free_item *xefi,
struct xfs_defer_pending **dfpp);
+struct xfs_rmap_intent;
+
+void xfs_rmap_defer_add(struct xfs_trans *tp, struct xfs_rmap_intent *ri);
+
#endif /* __LIBXFS_DEFER_ITEM_H_ */
diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c
index d60edaa23..22947e3c9 100644
--- a/libxfs/xfs_rmap.c
+++ b/libxfs/xfs_rmap.c
@@ -23,6 +23,7 @@
#include "xfs_inode.h"
#include "xfs_ag.h"
#include "xfs_health.h"
+#include "defer_item.h"
struct kmem_cache *xfs_rmap_intent_cache;
@@ -2655,10 +2656,7 @@ __xfs_rmap_add(
ri->ri_whichfork = whichfork;
ri->ri_bmap = *bmap;
- trace_xfs_rmap_defer(tp->t_mountp, ri);
-
- xfs_rmap_update_get_group(tp->t_mountp, ri);
- xfs_defer_add(tp, &ri->ri_list, &xfs_rmap_update_defer_type);
+ xfs_rmap_defer_add(tp, ri);
}
/* Map an extent into a file. */
diff --git a/libxfs/xfs_rmap.h b/libxfs/xfs_rmap.h
index 9d85dd2a6..b783dd4dd 100644
--- a/libxfs/xfs_rmap.h
+++ b/libxfs/xfs_rmap.h
@@ -176,9 +176,6 @@ struct xfs_rmap_intent {
struct xfs_perag *ri_pag;
};
-void xfs_rmap_update_get_group(struct xfs_mount *mp,
- struct xfs_rmap_intent *ri);
-
/* functions for updating the rmapbt based on bmbt map/unmap operations */
void xfs_rmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
int whichfork, struct xfs_bmbt_irec *imap);
next prev parent reply other threads:[~2024-10-02 1:20 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 1:00 [PATCHBOMB] xfsprogs: catch us up to 6.11 Darrick J. Wong
2024-10-02 1:04 ` [PATCHSET 1/6] xfsprogs: Debian and Ubuntu archive changes Darrick J. Wong
2024-10-02 1:05 ` [PATCH 1/6] debian: Update debhelper-compat level Darrick J. Wong
2024-10-02 1:06 ` [PATCH 2/6] debian: Update public release key Darrick J. Wong
2024-10-02 1:06 ` [PATCH 3/6] debian: Prevent recreating the orig tarball Darrick J. Wong
2024-10-02 1:06 ` [PATCH 4/6] debian: Add Build-Depends on pkg with systemd.pc Darrick J. Wong
2024-10-02 1:07 ` [PATCH 5/6] debian: Modernize build script Darrick J. Wong
2024-10-02 1:07 ` [PATCH 6/6] debian: Correct the day-of-week on 2024-09-04 Darrick J. Wong
2024-10-02 5:47 ` [PATCHSET 1/6] xfsprogs: Debian and Ubuntu archive changes Christoph Hellwig
2024-10-02 1:04 ` [PATCHSET 2/6] xfsprogs: do not depend on libattr Darrick J. Wong
2024-10-02 1:07 ` [PATCH 1/2] misc: clean up code around attr_list_by_handle calls Darrick J. Wong
2024-10-02 1:07 ` [PATCH 2/2] libfrog: emulate deprecated attrlist functionality in libattr Darrick J. Wong
2024-10-02 1:04 ` [PATCHSET v2.5 3/6] libxfs: resync with 6.11 Darrick J. Wong
2024-10-02 1:08 ` [PATCH 01/64] xfs: avoid redundant AGFL buffer invalidation Darrick J. Wong
2024-10-02 1:08 ` [PATCH 02/64] xfs: don't walk off the end of a directory data block Darrick J. Wong
2024-10-02 1:08 ` [PATCH 03/64] xfs: Remove header files which are included more than once Darrick J. Wong
2024-10-02 1:08 ` [PATCH 04/64] xfs: hoist extent size helpers to libxfs Darrick J. Wong
2024-10-02 1:09 ` [PATCH 05/64] xfs: hoist inode flag conversion functions " Darrick J. Wong
2024-10-02 1:09 ` [PATCH 06/64] xfs: hoist project id get/set " Darrick J. Wong
2024-10-02 1:09 ` [PATCH 07/64] libxfs: put all the inode functions in a single file Darrick J. Wong
2024-10-02 1:09 ` [PATCH 08/64] libxfs: pass IGET flags through to xfs_iread Darrick J. Wong
2024-10-02 5:47 ` Christoph Hellwig
2024-10-02 1:10 ` [PATCH 09/64] xfs: pack icreate initialization parameters into a separate structure Darrick J. Wong
2024-10-02 1:10 ` [PATCH 10/64] libxfs: " Darrick J. Wong
2024-10-02 1:10 ` [PATCH 11/64] xfs: implement atime updates in xfs_trans_ichgtime Darrick J. Wong
2024-10-02 1:10 ` [PATCH 12/64] libxfs: rearrange libxfs_trans_ichgtime call when creating inodes Darrick J. Wong
2024-10-02 5:48 ` Christoph Hellwig
2024-10-02 1:11 ` [PATCH 13/64] libxfs: set access time when creating files Darrick J. Wong
2024-10-02 5:49 ` Christoph Hellwig
2024-10-02 1:11 ` [PATCH 14/64] libxfs: when creating a file in a directory, set the project id based on the parent Darrick J. Wong
2024-10-02 5:49 ` Christoph Hellwig
2024-10-02 1:11 ` [PATCH 15/64] libxfs: pass flags2 from parent to child when creating files Darrick J. Wong
2024-10-02 5:49 ` Christoph Hellwig
2024-10-02 1:12 ` [PATCH 16/64] xfs: split new inode creation into two pieces Darrick J. Wong
2024-10-02 1:12 ` [PATCH 17/64] libxfs: " Darrick J. Wong
2024-10-02 1:12 ` [PATCH 18/64] libxfs: backport inode init code from the kernel Darrick J. Wong
2024-10-02 5:50 ` Christoph Hellwig
2024-10-02 1:12 ` [PATCH 19/64] libxfs: remove libxfs_dir_ialloc Darrick J. Wong
2024-10-02 5:51 ` Christoph Hellwig
2024-10-02 1:13 ` [PATCH 20/64] libxfs: implement get_random_u32 Darrick J. Wong
2024-10-02 5:51 ` Christoph Hellwig
2024-10-02 1:13 ` [PATCH 21/64] xfs: hoist new inode initialization functions to libxfs Darrick J. Wong
2024-10-02 1:13 ` [PATCH 22/64] xfs: hoist xfs_iunlink " Darrick J. Wong
2024-10-02 1:13 ` [PATCH 23/64] xfs: hoist xfs_{bump,drop}link " Darrick J. Wong
2024-10-02 1:14 ` [PATCH 24/64] xfs: separate the icreate logic around INIT_XATTRS Darrick J. Wong
2024-10-02 1:14 ` [PATCH 25/64] xfs: create libxfs helper to link a new inode into a directory Darrick J. Wong
2024-10-02 1:14 ` [PATCH 26/64] xfs: create libxfs helper to link an existing " Darrick J. Wong
2024-10-02 1:14 ` [PATCH 27/64] xfs: hoist inode free function to libxfs Darrick J. Wong
2024-10-02 1:15 ` [PATCH 28/64] xfs: create libxfs helper to remove an existing inode/name from a directory Darrick J. Wong
2024-10-02 1:15 ` [PATCH 29/64] xfs: create libxfs helper to exchange two directory entries Darrick J. Wong
2024-10-02 1:15 ` [PATCH 30/64] xfs: create libxfs helper to rename " Darrick J. Wong
2024-10-02 1:15 ` [PATCH 31/64] xfs: move dirent update hooks to xfs_dir2.c Darrick J. Wong
2024-10-02 1:16 ` [PATCH 32/64] xfs: don't use the incore struct xfs_sb for offsets into struct xfs_dsb Darrick J. Wong
2024-10-02 1:16 ` [PATCH 33/64] xfs: clean up extent free log intent item tracepoint callsites Darrick J. Wong
2024-10-02 1:16 ` [PATCH 34/64] xfs: convert "skip_discard" to a proper flags bitset Darrick J. Wong
2024-10-02 1:16 ` [PATCH 35/64] xfs: pass the fsbno to xfs_perag_intent_get Darrick J. Wong
2024-10-02 1:17 ` [PATCH 36/64] xfs: add a xefi_entry helper Darrick J. Wong
2024-10-02 1:17 ` [PATCH 37/64] xfs: reuse xfs_extent_free_cancel_item Darrick J. Wong
2024-10-02 1:17 ` [PATCH 38/64] xfs: remove duplicate asserts in xfs_defer_extent_free Darrick J. Wong
2024-10-02 1:17 ` [PATCH 39/64] xfs: remove xfs_defer_agfl_block Darrick J. Wong
2024-10-02 1:18 ` [PATCH 40/64] xfs: move xfs_extent_free_defer_add to xfs_extfree_item.c Darrick J. Wong
2024-10-02 1:18 ` [PATCH 41/64] xfs: give rmap btree cursor error tracepoints their own class Darrick J. Wong
2024-10-02 1:18 ` [PATCH 42/64] xfs: pass btree cursors to rmap btree tracepoints Darrick J. Wong
2024-10-02 1:19 ` [PATCH 43/64] xfs: clean up rmap log intent item tracepoint callsites Darrick J. Wong
2024-10-02 1:19 ` [PATCH 44/64] xfs: add a ri_entry helper Darrick J. Wong
2024-10-02 1:19 ` [PATCH 45/64] xfs: reuse xfs_rmap_update_cancel_item Darrick J. Wong
2024-10-02 1:19 ` [PATCH 46/64] xfs: don't bother calling xfs_rmap_finish_one_cleanup in xfs_rmap_finish_one Darrick J. Wong
2024-10-02 1:20 ` [PATCH 47/64] xfs: simplify usage of the rcur local variable " Darrick J. Wong
2024-10-02 1:20 ` Darrick J. Wong [this message]
2024-10-02 1:20 ` [PATCH 49/64] xfs: give refcount btree cursor error tracepoints their own class Darrick J. Wong
2024-10-02 1:20 ` [PATCH 50/64] xfs: create specialized classes for refcount tracepoints Darrick J. Wong
2024-10-02 1:21 ` [PATCH 51/64] xfs: pass btree cursors to refcount btree tracepoints Darrick J. Wong
2024-10-02 1:21 ` [PATCH 52/64] xfs: clean up refcount log intent item tracepoint callsites Darrick J. Wong
2024-10-02 1:21 ` [PATCH 53/64] xfs: add a ci_entry helper Darrick J. Wong
2024-10-02 1:21 ` [PATCH 54/64] xfs: reuse xfs_refcount_update_cancel_item Darrick J. Wong
2024-10-02 1:22 ` [PATCH 55/64] xfs: don't bother calling xfs_refcount_finish_one_cleanup in xfs_refcount_finish_one Darrick J. Wong
2024-10-02 1:22 ` [PATCH 56/64] xfs: simplify usage of the rcur local variable " Darrick J. Wong
2024-10-02 1:22 ` [PATCH 57/64] xfs: move xfs_refcount_update_defer_add to xfs_refcount_item.c Darrick J. Wong
2024-10-02 1:22 ` [PATCH 58/64] xfs: Avoid races with cnt_btree lastrec updates Darrick J. Wong
2024-10-02 1:23 ` [PATCH 59/64] xfs: AIL doesn't need manual pushing Darrick J. Wong
2024-10-02 1:23 ` [PATCH 60/64] xfs: background AIL push should target physical space Darrick J. Wong
2024-10-02 1:23 ` [PATCH 61/64] xfs: get rid of xfs_ag_resv_rmapbt_alloc Darrick J. Wong
2024-10-02 1:23 ` [PATCH 62/64] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES Darrick J. Wong
2024-10-02 1:24 ` [PATCH 63/64] xfs: fix di_onlink checking for V1/V2 inodes Darrick J. Wong
2024-10-02 1:24 ` [PATCH 64/64] xfs: xfs_finobt_count_blocks() walks the wrong btree Darrick J. Wong
2024-10-02 1:05 ` [PATCHSET v2.5 4/6] xfsprogs: port tools to new 6.11 APIs Darrick J. Wong
2024-10-02 1:24 ` [PATCH 1/4] xfs_db: port the unlink command to use libxfs_droplink Darrick J. Wong
2024-10-02 5:52 ` Christoph Hellwig
2024-10-02 1:25 ` [PATCH 2/4] xfs_db/mkfs/xfs_repair: port to use XFS_ICREATE_UNLINKABLE Darrick J. Wong
2024-10-02 5:53 ` Christoph Hellwig
2024-10-02 22:50 ` Darrick J. Wong
2024-10-04 11:08 ` Andrey Albershteyn
2024-10-02 1:25 ` [PATCH 3/4] xfs_db/mdrestore/repair: don't use the incore struct xfs_sb for offsets into struct xfs_dsb Darrick J. Wong
2024-10-02 5:54 ` Christoph Hellwig
2024-10-02 22:51 ` Darrick J. Wong
2024-10-02 1:25 ` [PATCH 4/4] xfs_db: port the iunlink command to use the libxfs iunlink function Darrick J. Wong
2024-10-02 5:54 ` Christoph Hellwig
2024-10-02 1:05 ` [PATCHSET 5/6] xfs_repair: cleanups for 6.11 Darrick J. Wong
2024-10-02 1:25 ` [PATCH 1/4] xfs_repair: fix exchrange upgrade Darrick J. Wong
2024-10-02 5:57 ` Christoph Hellwig
2024-10-02 1:26 ` [PATCH 2/4] xfs_repair: don't crash in get_inode_parent Darrick J. Wong
2024-10-02 5:58 ` Christoph Hellwig
2024-10-02 1:26 ` [PATCH 3/4] xfs_repair: use library functions to reset root/rbm/rsum inodes Darrick J. Wong
2024-10-02 5:58 ` Christoph Hellwig
2024-10-02 1:26 ` [PATCH 4/4] xfs_repair: use library functions for orphanage creation Darrick J. Wong
2024-10-02 5:58 ` Christoph Hellwig
2024-10-02 1:05 ` [PATCHSET v2.5 6/6] mkfs: clean up inode initialization code Darrick J. Wong
2024-10-02 1:26 ` [PATCH 1/2] mkfs: clean up the rtinit() function Darrick J. Wong
2024-10-02 6:03 ` Christoph Hellwig
2024-10-02 1:27 ` [PATCH 2/2] mkfs: break up the rest of " Darrick J. Wong
2024-10-02 6:04 ` Christoph Hellwig
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=172783102505.4036371.11209477625800698380.stgit@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=aalbersh@kernel.org \
--cc=cem@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).