Blame SOURCES/xfsprogs-5.12.0-libxfs-expose-inobtcount-in-xfs-geometry.patch

0bf83d
From bdeb014153934e1d98787a9609a7532baf6a5c37 Mon Sep 17 00:00:00 2001
0bf83d
From: Zorro Lang <zlang@redhat.com>
0bf83d
Date: Tue, 6 Apr 2021 16:56:32 -0400
0bf83d
Subject: [PATCH] libxfs: expose inobtcount in xfs geometry
0bf83d
0bf83d
Source kernel commit: bc41fa5321f93ecbabec177f888451cfc17ad66d
0bf83d
0bf83d
As xfs supports the feature of inode btree block counters now, expose
0bf83d
this feature flag in xfs geometry, for userspace can check if the
0bf83d
inobtcnt is enabled or not.
0bf83d
0bf83d
Signed-off-by: Zorro Lang <zlang@redhat.com>
0bf83d
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
0bf83d
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
0bf83d
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
0bf83d
---
0bf83d
0bf83d
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
0bf83d
index 714dba1..4e4a22e 100644
0bf83d
--- a/libxfs/xfs_fs.h
0bf83d
+++ b/libxfs/xfs_fs.h
0bf83d
@@ -232,6 +232,7 @@ typedef struct xfs_fsop_resblks {
0bf83d
 #define XFS_FSOP_GEOM_FLAGS_RMAPBT	0x80000	/* reverse mapping btree */
0bf83d
 #define XFS_FSOP_GEOM_FLAGS_REFLINK	0x100000 /* files can share blocks */
0bf83d
 #define XFS_FSOP_GEOM_FLAGS_BIGTIME	0x200000 /* 64-bit nsec timestamps */
0bf83d
+#define XFS_FSOP_GEOM_FLAGS_INOBTCNT	0x400000 /* inobt btree counter */
0bf83d
 
0bf83d
 /*
0bf83d
  * Minimum and maximum sizes need for growth checks.
0bf83d
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
0bf83d
index d11545b..6249e9a 100644
0bf83d
--- a/libxfs/xfs_sb.c
0bf83d
+++ b/libxfs/xfs_sb.c
0bf83d
@@ -1126,6 +1126,8 @@ xfs_fs_geometry(
0bf83d
 		geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK;
0bf83d
 	if (xfs_sb_version_hasbigtime(sbp))
0bf83d
 		geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
0bf83d
+	if (xfs_sb_version_hasinobtcounts(sbp))
0bf83d
+		geo->flags |= XFS_FSOP_GEOM_FLAGS_INOBTCNT;
0bf83d
 	if (xfs_sb_version_hassector(sbp))
0bf83d
 		geo->logsectsize = sbp->sb_logsectsize;
0bf83d
 	else