xfs: attach rtgroup objects to btree cursors
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:22:15 +0000 (14:22 -0700)
committerChristoph Hellwig <hch@lst.de>
Mon, 12 Aug 2024 08:40:03 +0000 (10:40 +0200)
Make it so that we can attach realtime group objects to btree cursors.
This will be crucial for enabling rmap btrees in realtime groups.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_btree.c
libxfs/xfs_btree.h

index 51ccb568226bff371660399366906c62e7cea262..0f25703c12a02a6c45bd526f2d40af53c666b607 100644 (file)
@@ -28,6 +28,7 @@
 #include "xfile.h"
 #include "buf_mem.h"
 #include "xfs_btree_mem.h"
+#include "xfs_rtgroup.h"
 
 /*
  * Btree magic numbers.
@@ -527,7 +528,8 @@ xfs_btree_del_cursor(
                        xfs_perag_put(cur->bc_ag.pag);
                break;
        case XFS_BTREE_TYPE_INODE:
-               /* nothing to do */
+               if (cur->bc_ino.rtg)
+                       xfs_rtgroup_put(cur->bc_ino.rtg);
                break;
        case XFS_BTREE_TYPE_MEM:
                if (cur->bc_mem.pag)
index 1f3aac749225d1ee4209d27b4c25a0d709aa14b0..ea7cf4f0ea5b2fc0ec45bf88a6eff09420767935 100644 (file)
@@ -12,6 +12,7 @@ struct xfs_mount;
 struct xfs_trans;
 struct xfs_ifork;
 struct xfs_perag;
+struct xfs_rtgroup;
 
 /*
  * Generic key, ptr and record wrapper structures.
@@ -262,6 +263,7 @@ struct xfs_btree_cur
        union {
                struct {
                        struct xfs_inode        *ip;
+                       struct xfs_rtgroup      *rtg;   /* if realtime metadata */
                        short                   forksize;
                        char                    whichfork;
                        struct xbtree_ifakeroot *ifake; /* for staging cursor */