From 9a75cb96902add8581b42a3a5f95e6db6579ce15 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 15 Aug 2024 11:56:37 -0700 Subject: [PATCH] fixup --- include/libxfs.h | 1 + include/xfs_mount.h | 9 +++++++++ libxfs/Makefile | 2 ++ libxfs/init.c | 5 +++-- libxfs/xfs_rtrmap_btree.c | 4 +--- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/libxfs.h b/include/libxfs.h index b14533453..590ac92e9 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -97,6 +97,7 @@ struct iomap; #include "xfs_metadir.h" #include "xfs_rtgroup.h" #include "xfs_rtbitmap.h" +#include "xfs_rtrmap_btree.h" #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/include/xfs_mount.h b/include/xfs_mount.h index 409587ab8..17252f193 100644 --- a/include/xfs_mount.h +++ b/include/xfs_mount.h @@ -78,11 +78,14 @@ typedef struct xfs_mount { uint m_bmap_dmnr[2]; /* XFS_BMAP_BLOCK_DMINRECS */ uint m_rmap_mxr[2]; /* max rmap btree records */ uint m_rmap_mnr[2]; /* min rmap btree records */ + uint m_rtrmap_mxr[2]; /* max rtrmap btree records */ + uint m_rtrmap_mnr[2]; /* min rtrmap btree records */ uint m_refc_mxr[2]; /* max refc btree records */ uint m_refc_mnr[2]; /* min refc btree records */ uint m_alloc_maxlevels; /* max alloc btree levels */ uint m_bm_maxlevels[2]; /* max bmap btree levels */ uint m_rmap_maxlevels; /* max rmap btree levels */ + uint m_rtrmap_maxlevels; /* max rtrmap btree level */ uint m_refc_maxlevels; /* max refc btree levels */ unsigned int m_agbtree_maxlevels; /* max level of all AG btrees */ unsigned int m_rtbtree_maxlevels; /* max level of all rt btrees */ @@ -223,6 +226,12 @@ __XFS_HAS_FEAT(metadir, METADIR) __XFS_HAS_FEAT(rtgroups, RTGROUPS) __XFS_HAS_FEAT(rtsb, RTSB) +static inline bool xfs_has_rtrmapbt(struct xfs_mount *mp) +{ + return xfs_has_rtgroups(mp) && xfs_has_realtime(mp) && + xfs_has_rmapbt(mp); +} + /* Kernel mount features that we don't support */ #define __XFS_UNSUPP_FEAT(name) \ static inline bool xfs_has_ ## name (struct xfs_mount *mp) \ diff --git a/libxfs/Makefile b/libxfs/Makefile index 42660ddb7..cfb703bc0 100644 --- a/libxfs/Makefile +++ b/libxfs/Makefile @@ -64,6 +64,7 @@ HFILES = \ xfs_rmap_btree.h \ xfs_rtbitmap.h \ xfs_rtgroup.h \ + xfs_rtrmap_btree.h \ xfs_sb.h \ xfs_shared.h \ xfs_trans_resv.h \ @@ -124,6 +125,7 @@ CFILES = buf_mem.c \ xfs_rmap_btree.c \ xfs_rtbitmap.c \ xfs_rtgroup.c \ + xfs_rtrmap_btree.c \ xfs_sb.c \ xfs_symlink_remote.c \ xfs_trans_inode.c \ diff --git a/libxfs/init.c b/libxfs/init.c index 8a86003ee..4d72b1944 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -21,6 +21,7 @@ #include "xfs_trans.h" #include "xfs_rmap_btree.h" #include "xfs_refcount_btree.h" +#include "xfs_metafile.h" #include "libfrog/platform.h" #include "libxfs/xfile.h" #include "libxfs/buf_mem.h" @@ -598,8 +599,7 @@ static inline void xfs_rtbtree_compute_maxlevels( struct xfs_mount *mp) { - /* This will be filled in later. */ - mp->m_rtbtree_maxlevels = 0; + mp->m_rtbtree_maxlevels = mp->m_rtrmap_maxlevels; } /* Compute maximum possible height of all btrees. */ @@ -615,6 +615,7 @@ libxfs_compute_all_maxlevels( igeo->attr_fork_offset = xfs_bmap_compute_attr_offset(mp); xfs_ialloc_setup_geometry(mp); xfs_rmapbt_compute_maxlevels(mp); + xfs_rtrmapbt_compute_maxlevels(mp); xfs_refcountbt_compute_maxlevels(mp); xfs_agbtree_compute_maxlevels(mp); diff --git a/libxfs/xfs_rtrmap_btree.c b/libxfs/xfs_rtrmap_btree.c index defbe0569..a29fb6d5c 100644 --- a/libxfs/xfs_rtrmap_btree.c +++ b/libxfs/xfs_rtrmap_btree.c @@ -3,7 +3,7 @@ * Copyright (c) 2018-2024 Oracle. All Rights Reserved. * Author: Darrick J. Wong */ -#include "xfs.h" +#include "libxfs_priv.h" #include "xfs_fs.h" #include "xfs_shared.h" #include "xfs_format.h" @@ -21,8 +21,6 @@ #include "xfs_rtrmap_btree.h" #include "xfs_trace.h" #include "xfs_cksum.h" -#include "xfs_error.h" -#include "xfs_extent_busy.h" #include "xfs_rtgroup.h" static struct kmem_cache *xfs_rtrmapbt_cur_cache; -- 2.50.1