xfs: pass the xfs_defer_pending object to iop_recover
authorDarrick J. Wong <djwong@kernel.org>
Wed, 22 Nov 2023 18:38:10 +0000 (10:38 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 7 Dec 2023 02:45:14 +0000 (18:45 -0800)
Now that log intent item recovery recreates the xfs_defer_pending state,
we should pass that into the ->iop_recover routines so that the intent
item can finish the recreation work.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_attr_item.c
fs/xfs/xfs_bmap_item.c
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_refcount_item.c
fs/xfs/xfs_rmap_item.c
fs/xfs/xfs_trans.h

index a32716b8cbbd2412a3ba1d9795b94bda3c59a363..6119a7a480a05c992a68cb1e79c480e0bad83616 100644 (file)
@@ -545,9 +545,10 @@ xfs_attri_validate(
  */
 STATIC int
 xfs_attri_item_recover(
-       struct xfs_log_item             *lip,
+       struct xfs_defer_pending        *dfp,
        struct list_head                *capture_list)
 {
+       struct xfs_log_item             *lip = dfp->dfp_intent;
        struct xfs_attri_log_item       *attrip = ATTRI_ITEM(lip);
        struct xfs_attr_intent          *attr;
        struct xfs_mount                *mp = lip->li_log->l_mp;
index 6cbae4fdf43fe4c5883e83c562286efb702e248e..3ef55de370b5e5e09e1489befb9b25918e3b2d91 100644 (file)
@@ -486,11 +486,12 @@ xfs_bui_validate(
  */
 STATIC int
 xfs_bui_item_recover(
-       struct xfs_log_item             *lip,
+       struct xfs_defer_pending        *dfp,
        struct list_head                *capture_list)
 {
        struct xfs_bmap_intent          fake = { };
        struct xfs_trans_res            resv;
+       struct xfs_log_item             *lip = dfp->dfp_intent;
        struct xfs_bui_log_item         *buip = BUI_ITEM(lip);
        struct xfs_trans                *tp;
        struct xfs_inode                *ip = NULL;
index cf0ddeb7058081a6b050ff133fc72f62b279e5f6..a8245c5ffe496a9c9f59d19a7109afefb0a07940 100644 (file)
@@ -657,10 +657,11 @@ xfs_efi_validate_ext(
  */
 STATIC int
 xfs_efi_item_recover(
-       struct xfs_log_item             *lip,
+       struct xfs_defer_pending        *dfp,
        struct list_head                *capture_list)
 {
        struct xfs_trans_res            resv;
+       struct xfs_log_item             *lip = dfp->dfp_intent;
        struct xfs_efi_log_item         *efip = EFI_ITEM(lip);
        struct xfs_mount                *mp = lip->li_log->l_mp;
        struct xfs_efd_log_item         *efdp;
index b9d2152a2bad61f939b78c9d76f8419d4ad370bd..ff768217f2c795572d403e7647f7a2b570444fb7 100644 (file)
@@ -2583,7 +2583,7 @@ xlog_recover_process_intents(
                 * The recovery function can free the log item, so we must not
                 * access lip after it returns.
                 */
-               error = ops->iop_recover(lip, &capture_list);
+               error = ops->iop_recover(dfp, &capture_list);
                if (error) {
                        trace_xlog_intent_recovery_failed(log->l_mp, error,
                                        ops->iop_recover);
index b88cb2e982278562e5e72ba2c7c6ab78dc9d96e5..3456201aa3e61ac6a523ec625f911e676553c64d 100644 (file)
@@ -474,10 +474,11 @@ xfs_cui_validate_phys(
  */
 STATIC int
 xfs_cui_item_recover(
-       struct xfs_log_item             *lip,
+       struct xfs_defer_pending        *dfp,
        struct list_head                *capture_list)
 {
        struct xfs_trans_res            resv;
+       struct xfs_log_item             *lip = dfp->dfp_intent;
        struct xfs_cui_log_item         *cuip = CUI_ITEM(lip);
        struct xfs_cud_log_item         *cudp;
        struct xfs_trans                *tp;
index c30d4a4a14b2a53723f34f91a3094c7e836bc323..dfd5a3e4b1fb5e7e2b8ab8ba9944b2d894e7e3f5 100644 (file)
@@ -504,10 +504,11 @@ xfs_rui_validate_map(
  */
 STATIC int
 xfs_rui_item_recover(
-       struct xfs_log_item             *lip,
+       struct xfs_defer_pending        *dfp,
        struct list_head                *capture_list)
 {
        struct xfs_trans_res            resv;
+       struct xfs_log_item             *lip = dfp->dfp_intent;
        struct xfs_rui_log_item         *ruip = RUI_ITEM(lip);
        struct xfs_rud_log_item         *rudp;
        struct xfs_trans                *tp;
index 6e3646d524ceb6060bbf7219d367918a03a700f2..4e38357237c31bb86bdebb0344d1364a7562dd4b 100644 (file)
@@ -66,6 +66,8 @@ struct xfs_log_item {
        { (1u << XFS_LI_DIRTY),         "DIRTY" }, \
        { (1u << XFS_LI_WHITEOUT),      "WHITEOUT" }
 
+struct xfs_defer_pending;
+
 struct xfs_item_ops {
        unsigned flags;
        void (*iop_size)(struct xfs_log_item *, int *, int *);
@@ -78,7 +80,7 @@ struct xfs_item_ops {
        xfs_lsn_t (*iop_committed)(struct xfs_log_item *, xfs_lsn_t);
        uint (*iop_push)(struct xfs_log_item *, struct list_head *);
        void (*iop_release)(struct xfs_log_item *);
-       int (*iop_recover)(struct xfs_log_item *lip,
+       int (*iop_recover)(struct xfs_defer_pending *dfp,
                           struct list_head *capture_list);
        bool (*iop_match)(struct xfs_log_item *item, uint64_t id);
        struct xfs_log_item *(*iop_relog)(struct xfs_log_item *intent,