]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: add an incompat feature bit for zoned RT devices
authorChristoph Hellwig <hch@lst.de>
Fri, 23 Aug 2024 14:27:52 +0000 (16:27 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 5 Nov 2024 08:29:52 +0000 (09:29 +0100)
Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_format.h
fs/xfs/libxfs/xfs_sb.c
fs/xfs/xfs_mount.h

index 8e3536d7759e0f0dbf65b90b605bb53b162ee4d9..aa968c19748d9f97eb0bafd3ae06480a4e0cd30a 100644 (file)
@@ -395,6 +395,8 @@ xfs_sb_has_ro_compat_feature(
 #define XFS_SB_FEAT_INCOMPAT_EXCHRANGE (1 << 6)  /* exchangerange supported */
 #define XFS_SB_FEAT_INCOMPAT_PARENT    (1 << 7)  /* parent pointers */
 #define XFS_SB_FEAT_INCOMPAT_METADIR   (1 << 8)  /* metadata dir tree */
+#define XFS_SB_FEAT_INCOMPAT_ZONED     (1U << 31)/* zoned RT allocator */
+
 #define XFS_SB_FEAT_INCOMPAT_ALL \
                (XFS_SB_FEAT_INCOMPAT_FTYPE | \
                 XFS_SB_FEAT_INCOMPAT_SPINODES | \
@@ -404,7 +406,8 @@ xfs_sb_has_ro_compat_feature(
                 XFS_SB_FEAT_INCOMPAT_NREXT64 | \
                 XFS_SB_FEAT_INCOMPAT_EXCHRANGE | \
                 XFS_SB_FEAT_INCOMPAT_PARENT | \
-                XFS_SB_FEAT_INCOMPAT_METADIR)
+                XFS_SB_FEAT_INCOMPAT_METADIR | \
+                XFS_SB_FEAT_INCOMPAT_ZONED)
 
 #define XFS_SB_FEAT_INCOMPAT_UNKNOWN   ~XFS_SB_FEAT_INCOMPAT_ALL
 static inline bool
index ab5ccb8d6566343d7b6f0cd7da7c276cb53b0184..9dcc8a08fd02a11c485727771f51b6f7dbdeebca 100644 (file)
@@ -185,6 +185,8 @@ xfs_sb_version_to_features(
                features |= XFS_FEAT_PARENT;
        if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_METADIR)
                features |= XFS_FEAT_METADIR;
+       if (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_ZONED)
+               features |= XFS_FEAT_ZONED;
 
        return features;
 }
index 0d3bfce0bd99e8e6b2e21b443e5f58cb5e5c30f3..c0f870130fbb8278d1fc672a59181573ae9d2a83 100644 (file)
@@ -343,6 +343,7 @@ typedef struct xfs_mount {
 #define XFS_FEAT_NREXT64       (1ULL << 26)    /* large extent counters */
 #define XFS_FEAT_EXCHANGE_RANGE        (1ULL << 27)    /* exchange range */
 #define XFS_FEAT_METADIR       (1ULL << 28)    /* metadata directory tree */
+#define XFS_FEAT_ZONED         (1ULL << 29)
 
 /* Mount features */
 #define XFS_FEAT_NOATTR2       (1ULL << 48)    /* disable attr2 creation */
@@ -399,6 +400,7 @@ __XFS_HAS_FEAT(needsrepair, NEEDSREPAIR)
 __XFS_HAS_FEAT(large_extent_counts, NREXT64)
 __XFS_HAS_FEAT(exchange_range, EXCHANGE_RANGE)
 __XFS_HAS_FEAT(metadir, METADIR)
+__XFS_HAS_FEAT(zoned, ZONED)
 
 static inline bool xfs_has_rtgroups(const struct xfs_mount *mp)
 {
@@ -409,7 +411,9 @@ static inline bool xfs_has_rtgroups(const struct xfs_mount *mp)
 static inline bool xfs_has_rtsb(const struct xfs_mount *mp)
 {
        /* all rtgroups filesystems with an rt section have an rtsb */
-       return xfs_has_rtgroups(mp) && xfs_has_realtime(mp);
+       return xfs_has_rtgroups(mp) &&
+               xfs_has_realtime(mp) &&
+               !xfs_has_zoned(mp);
 }
 
 static inline bool xfs_has_rtrmapbt(const struct xfs_mount *mp)