]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
fixup
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Aug 2024 12:06:48 +0000 (14:06 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 12 Aug 2024 11:53:50 +0000 (13:53 +0200)
include/xfs_mount.h
libxfs/defer_item.c

index 17252f193744f4ea4b2a28fc84807921276f6186..2a8dad8a942a11b9a170f13899421877a4fff471 100644 (file)
@@ -323,6 +323,18 @@ struct xfs_defer_drain { /* empty */ };
 static inline void xfs_perag_intent_hold(struct xfs_perag *pag) {}
 static inline void xfs_perag_intent_rele(struct xfs_perag *pag) {}
 
+struct xfs_rtgroup;
+
+#define xfs_rtgroup_intent_get(mp, rgno) \
+       xfs_rtgroup_get((mp), xfs_rtb_to_rgno((mp), (rgno)))
+#define xfs_rtgroup_intent_put(rtg)            xfs_rtgroup_put(rtg)
+
+static inline void xfs_rtgroup_intent_hold(struct xfs_rtgroup *rtg) { }
+static inline void xfs_rtgroup_intent_rele(struct xfs_rtgroup *rtg) { }
+
+#define xfs_drain_free(dr)             ((void)0)
+#define xfs_drain_init(dr)             ((void)0)
+
 static inline void libxfs_buftarg_drain(struct xfs_buftarg *btp)
 {
        cache_purge(btp->bcache);
index 62907c6d0cc997c36989c86126f0f2c73afd4e78..e4f2c75dec7f1c5a66ee5a61404e17c3bfdef939 100644 (file)
@@ -87,11 +87,8 @@ xfs_extent_free_defer_add(
        struct xfs_mount                *mp = tp->t_mountp;
 
        if (xfs_efi_is_realtime(xefi)) {
-               xfs_rgnumber_t          rgno;
-
-               rgno = xfs_rtb_to_rgno(mp, xefi->xefi_startblock);
-               xefi->xefi_rtg = xfs_rtgroup_get(mp, rgno);
-
+               xefi->xefi_rtg = xfs_rtgroup_intent_get(mp,
+                                               xefi->xefi_startblock);
                *dfpp = xfs_defer_add(tp, &xefi->xefi_list,
                                &xfs_rtextent_free_defer_type);
                return;
@@ -203,7 +200,7 @@ xfs_rtextent_free_cancel_item(
 {
        struct xfs_extent_free_item     *xefi = xefi_entry(item);
 
-       xfs_rtgroup_put(xefi->xefi_rtg);
+       xfs_rtgroup_intent_put(xefi->xefi_rtg);
        kmem_cache_free(xfs_extfree_item_cache, xefi);
 }
 
@@ -337,13 +334,12 @@ xfs_rmap_defer_add(
         * section updates.
         */
        if (ri->ri_realtime) {
-               xfs_rgnumber_t  rgno;
-
-               rgno = xfs_rtb_to_rgno(mp, ri->ri_bmap.br_startblock);
-               ri->ri_rtg = xfs_rtgroup_get(mp, rgno);
+               ri->ri_rtg = xfs_rtgroup_intent_get(mp,
+                                               ri->ri_bmap.br_startblock);
                xfs_defer_add(tp, &ri->ri_list, &xfs_rtrmap_update_defer_type);
        } else {
-               ri->ri_pag = xfs_perag_intent_get(mp, ri->ri_bmap.br_startblock);
+               ri->ri_pag = xfs_perag_intent_get(mp,
+                                               ri->ri_bmap.br_startblock);
                xfs_defer_add(tp, &ri->ri_list, &xfs_rmap_update_defer_type);
        }
 }
@@ -444,7 +440,7 @@ xfs_rtrmap_update_cancel_item(
 {
        struct xfs_rmap_intent          *ri = ri_entry(item);
 
-       xfs_rtgroup_put(ri->ri_rtg);
+       xfs_rtgroup_intent_put(ri->ri_rtg);
        kmem_cache_free(xfs_rmap_intent_cache, ri);
 }
 
@@ -667,10 +663,8 @@ xfs_bmap_update_get_group(
 {
        if (xfs_ifork_is_realtime(bi->bi_owner, bi->bi_whichfork)) {
                if (xfs_has_rtgroups(mp)) {
-                       xfs_rgnumber_t  rgno;
-
-                       rgno = xfs_rtb_to_rgno(mp, bi->bi_bmap.br_startblock);
-                       bi->bi_rtg = xfs_rtgroup_get(mp, rgno);
+                       bi->bi_rtg = xfs_rtgroup_intent_get(mp,
+                                               bi->bi_bmap.br_startblock);
                } else {
                        bi->bi_rtg = NULL;
                }
@@ -706,8 +700,9 @@ xfs_bmap_update_put_group(
        struct xfs_bmap_intent  *bi)
 {
        if (xfs_ifork_is_realtime(bi->bi_owner, bi->bi_whichfork)) {
-               if (xfs_has_rtgroups(bi->bi_owner->i_mount))
-                       xfs_rtgroup_put(bi->bi_rtg);
+               if (xfs_has_rtgroups(bi->bi_owner->i_mount)) {
+                       xfs_rtgroup_intent_put(bi->bi_rtg);
+               }
                return;
        }