summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_refcount_item.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-11-30 12:31:30 -0800
committerDarrick J. Wong <djwong@kernel.org>2023-12-06 18:45:17 -0800
commita49c708f9a445457f6a5905732081871234f61c6 (patch)
tree283d657946be7882263c48661ebda12f5d55647e /fs/xfs/xfs_refcount_item.c
parent8a9aa763e17c5490d3526cbf4c9484d76ecbbe39 (diff)
downloadlinux-a49c708f9a445457f6a5905732081871234f61c6.tar.gz
linux-a49c708f9a445457f6a5905732081871234f61c6.tar.bz2
linux-a49c708f9a445457f6a5905732081871234f61c6.zip
xfs: move ->iop_relog to struct xfs_defer_op_type
The only log items that need relogging are the ones created for deferred work operations, and the only part of the code base that relogs log items is the deferred work machinery. Move the function pointers. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_refcount_item.c')
-rw-r--r--fs/xfs/xfs_refcount_item.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c
index d218a9ed4d82..9974be81cb2b 100644
--- a/fs/xfs/xfs_refcount_item.c
+++ b/fs/xfs/xfs_refcount_item.c
@@ -501,6 +501,27 @@ abort_error:
return error;
}
+/* Relog an intent item to push the log tail forward. */
+static struct xfs_log_item *
+xfs_refcount_relog_intent(
+ struct xfs_trans *tp,
+ struct xfs_log_item *intent,
+ struct xfs_log_item *done_item)
+{
+ struct xfs_cui_log_item *cuip;
+ struct xfs_phys_extent *pmap;
+ unsigned int count;
+
+ count = CUI_ITEM(intent)->cui_format.cui_nextents;
+ pmap = CUI_ITEM(intent)->cui_format.cui_extents;
+
+ cuip = xfs_cui_init(tp->t_mountp, count);
+ memcpy(cuip->cui_format.cui_extents, pmap, count * sizeof(*pmap));
+ atomic_set(&cuip->cui_next_extent, count);
+
+ return &cuip->cui_item;
+}
+
const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
.max_items = XFS_CUI_MAX_FAST_EXTENTS,
.create_intent = xfs_refcount_update_create_intent,
@@ -510,6 +531,7 @@ const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
.finish_cleanup = xfs_refcount_finish_one_cleanup,
.cancel_item = xfs_refcount_update_cancel_item,
.recover_work = xfs_refcount_recover_work,
+ .relog_intent = xfs_refcount_relog_intent,
};
STATIC bool
@@ -520,27 +542,6 @@ xfs_cui_item_match(
return CUI_ITEM(lip)->cui_format.cui_id == intent_id;
}
-/* Relog an intent item to push the log tail forward. */
-static struct xfs_log_item *
-xfs_cui_item_relog(
- struct xfs_log_item *intent,
- struct xfs_log_item *done_item,
- struct xfs_trans *tp)
-{
- struct xfs_cui_log_item *cuip;
- struct xfs_phys_extent *pmap;
- unsigned int count;
-
- count = CUI_ITEM(intent)->cui_format.cui_nextents;
- pmap = CUI_ITEM(intent)->cui_format.cui_extents;
-
- cuip = xfs_cui_init(tp->t_mountp, count);
- memcpy(cuip->cui_format.cui_extents, pmap, count * sizeof(*pmap));
- atomic_set(&cuip->cui_next_extent, count);
-
- return &cuip->cui_item;
-}
-
static const struct xfs_item_ops xfs_cui_item_ops = {
.flags = XFS_ITEM_INTENT,
.iop_size = xfs_cui_item_size,
@@ -548,7 +549,6 @@ static const struct xfs_item_ops xfs_cui_item_ops = {
.iop_unpin = xfs_cui_item_unpin,
.iop_release = xfs_cui_item_release,
.iop_match = xfs_cui_item_match,
- .iop_relog = xfs_cui_item_relog,
};
static inline void