]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move ->iop_recover to xfs_defer_op_type
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 23:07:31 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:23 +0000 (14:06 -0700)
Source kernel commit: db7ccc0bac2add5a41b66578e376b49328fc99d0

Finish off the series by moving the intent item recovery function
pointer to the xfs_defer_op_type struct, since this is really a deferred
work function now.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
include/xfs_trace.h
libxfs/xfs_defer.c
libxfs/xfs_defer.h

index 7fd446ad42bf9c5356fcc4b24da0ef315901a97e..c79a4bd74dcba6059acc4ee6ebd601e9a70b0862 100644 (file)
 
 #define trace_xfs_fs_mark_healthy(a,b)         ((void) 0)
 
+#define trace_xlog_intent_recovery_failed(...) ((void) 0)
+
 #endif /* __TRACE_H__ */
index 4ef9867cca0e646a5f9e5a6913e945e5a91e4757..54865b73b47fe69f0d1697934eff743e0bb451fa 100644 (file)
@@ -708,6 +708,23 @@ xfs_defer_cancel_recovery(
        xfs_defer_pending_cancel_work(mp, dfp);
 }
 
+/* Replay the deferred work item created from a recovered log intent item. */
+int
+xfs_defer_finish_recovery(
+       struct xfs_mount                *mp,
+       struct xfs_defer_pending        *dfp,
+       struct list_head                *capture_list)
+{
+       const struct xfs_defer_op_type  *ops = defer_op_types[dfp->dfp_type];
+       int                             error;
+
+       error = ops->recover_work(dfp, capture_list);
+       if (error)
+               trace_xlog_intent_recovery_failed(mp, error,
+                               ops->recover_work);
+       return error;
+}
+
 /*
  * Move deferred ops from one transaction to another and reset the source to
  * initial state. This is primarily used to carry state forward across
index c1a648e991748983bfb19f8ddf558493cfcfba25..ef86a7f9b059508280d42994924210205b3f876d 100644 (file)
@@ -57,6 +57,8 @@ struct xfs_defer_op_type {
        void (*finish_cleanup)(struct xfs_trans *tp,
                        struct xfs_btree_cur *state, int error);
        void (*cancel_item)(struct list_head *item);
+       int (*recover_work)(struct xfs_defer_pending *dfp,
+                           struct list_head *capture_list);
        unsigned int            max_items;
 };
 
@@ -130,6 +132,8 @@ void xfs_defer_start_recovery(struct xfs_log_item *lip,
                enum xfs_defer_ops_type dfp_type, struct list_head *r_dfops);
 void xfs_defer_cancel_recovery(struct xfs_mount *mp,
                struct xfs_defer_pending *dfp);
+int xfs_defer_finish_recovery(struct xfs_mount *mp,
+               struct xfs_defer_pending *dfp, struct list_head *capture_list);
 
 static inline void
 xfs_defer_add_item(