From: Darrick J. Wong <djwong@xxxxxxxxxx> 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@xxxxxxxxxx> --- fs/xfs/libxfs/xfs_btree.c | 4 ++++ fs/xfs/libxfs/xfs_btree.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c index 00bc1dd73675..c02748e16075 100644 --- a/fs/xfs/libxfs/xfs_btree.c +++ b/fs/xfs/libxfs/xfs_btree.c @@ -31,6 +31,7 @@ #include "scrub/xfile.h" #include "scrub/xfbtree.h" #include "xfs_btree_mem.h" +#include "xfs_rtgroup.h" /* * Btree magic numbers. @@ -476,6 +477,9 @@ xfs_btree_del_cursor( xfs_is_shutdown(cur->bc_mp) || error != 0); if (unlikely(cur->bc_flags & XFS_BTREE_STAGING)) kmem_free(cur->bc_ops); + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + !(cur->bc_flags & XFS_BTREE_IN_MEMORY) && cur->bc_ino.rtg) + xfs_rtgroup_put(cur->bc_ino.rtg); if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS) && !(cur->bc_flags & XFS_BTREE_IN_MEMORY) && cur->bc_ag.pag) xfs_perag_put(cur->bc_ag.pag); diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h index b15bc77369cf..125f45731a54 100644 --- a/fs/xfs/libxfs/xfs_btree.h +++ b/fs/xfs/libxfs/xfs_btree.h @@ -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. @@ -244,6 +245,7 @@ struct xfs_btree_cur_ag { /* Btree-in-inode cursor information */ struct xfs_btree_cur_ino { struct xfs_inode *ip; + struct xfs_rtgroup *rtg; /* if realtime metadata */ struct xbtree_ifakeroot *ifake; /* for staging cursor */ int allocated; short forksize;