]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
fixup
authorChristoph Hellwig <hch@lst.de>
Mon, 5 Aug 2024 18:10:11 +0000 (11:10 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Aug 2024 12:53:49 +0000 (05:53 -0700)
libxfs/defer_item.c

index 98a291c7b785e1b2f1a73000f0339c49bf3547fb..93f5d788daeec51cc3cf7e867fd20b7ddc124897 100644 (file)
@@ -498,8 +498,18 @@ xfs_bmap_update_get_group(
        struct xfs_mount        *mp,
        struct xfs_bmap_intent  *bi)
 {
-       if (xfs_ifork_is_realtime(bi->bi_owner, bi->bi_whichfork))
+       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);
+               } else {
+                       bi->bi_rtg = NULL;
+               }
+
                return;
+       }
 
        /*
         * Bump the intent count on behalf of the deferred rmap and refcount
@@ -528,8 +538,11 @@ static inline void
 xfs_bmap_update_put_group(
        struct xfs_bmap_intent  *bi)
 {
-       if (xfs_ifork_is_realtime(bi->bi_owner, bi->bi_whichfork))
+       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);
                return;
+       }
 
        xfs_perag_intent_put(bi->bi_pag);
 }