From: Darrick J. Wong <djwong@xxxxxxxxxx> Add a new XFS_SCRUB_METAPATH subtype so that we can scrub the metadata directory tree path to the refcount btree file for each rt group. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- fs/xfs/libxfs/xfs_fs.h | 3 ++- fs/xfs/scrub/metapath.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h index 7847da61db232..4159e96d01ae6 100644 --- a/fs/xfs/libxfs/xfs_fs.h +++ b/fs/xfs/libxfs/xfs_fs.h @@ -806,9 +806,10 @@ struct xfs_scrub_metadata { #define XFS_SCRUB_METAPATH_GRPQUOTA 3 #define XFS_SCRUB_METAPATH_PRJQUOTA 4 #define XFS_SCRUB_METAPATH_RTRMAPBT 5 +#define XFS_SCRUB_METAPATH_RTREFCBT 6 /* Number of metapath sm_ino values */ -#define XFS_SCRUB_METAPATH_NR 6 +#define XFS_SCRUB_METAPATH_NR 7 /* * ioctl limits diff --git a/fs/xfs/scrub/metapath.c b/fs/xfs/scrub/metapath.c index 6afd117c890e9..447bdbea210d2 100644 --- a/fs/xfs/scrub/metapath.c +++ b/fs/xfs/scrub/metapath.c @@ -23,6 +23,7 @@ #include "xfs_attr.h" #include "xfs_rtgroup.h" #include "xfs_rtrmap_btree.h" +#include "xfs_rtrefcount_btree.h" #include "scrub/scrub.h" #include "scrub/common.h" #include "scrub/trace.h" @@ -106,6 +107,7 @@ xchk_setup_metapath( switch (sc->sm->sm_ino) { case XFS_SCRUB_METAPATH_RTRMAPBT: + case XFS_SCRUB_METAPATH_RTREFCBT: /* empty */ break; default: @@ -157,6 +159,18 @@ xchk_setup_metapath( xfs_rtgroup_put(rtg); } break; + case XFS_SCRUB_METAPATH_RTREFCBT: + error = xfs_rtrefcountbt_create_path(mp, sc->sm->sm_agno, + &path); + if (error) + return error; + mpath->path = path; + rtg = xfs_rtgroup_get(mp, sc->sm->sm_agno); + if (rtg) { + ip = rtg->rtg_refcountip; + xfs_rtgroup_put(rtg); + } + break; default: return -EINVAL; }