@@ -500,7 +500,10 @@ xfs_sb_has_incompat_feature(
return (sbp->sb_features_incompat & feature) != 0;
}
-#define XFS_SB_FEAT_INCOMPAT_LOG_ALL 0
+#define XFS_SB_FEAT_INCOMPAT_LOG_ATOMIC_SWAP (1 << 0)
+#define XFS_SB_FEAT_INCOMPAT_LOG_ALL \
+ (XFS_SB_FEAT_INCOMPAT_LOG_ATOMIC_SWAP)
+
#define XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN ~XFS_SB_FEAT_INCOMPAT_LOG_ALL
static inline bool
xfs_sb_has_incompat_log_feature(
@@ -614,6 +617,12 @@ static inline bool xfs_sb_version_hasrtrmapbt(struct xfs_sb *sbp)
xfs_sb_version_hasrmapbt(sbp);
}
+static inline bool xfs_sb_version_hasatomicswap(struct xfs_sb *sbp)
+{
+ return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
+ (sbp->sb_features_log_incompat & XFS_SB_FEAT_INCOMPAT_LOG_ATOMIC_SWAP);
+}
+
/*
* end of superblock version macros
*/
@@ -251,6 +251,7 @@ typedef struct xfs_fsop_resblks {
#define XFS_FSOP_GEOM_FLAGS_RMAPBT (1 << 19) /* reverse mapping btree */
#define XFS_FSOP_GEOM_FLAGS_REFLINK (1 << 20) /* files can share blocks */
#define XFS_FSOP_GEOM_FLAGS_BIGTIME (1 << 21) /* 64-bit nsec timestamps */
+#define XFS_FSOP_GEOM_FLAGS_ATOMIC_SWAP (1 << 22) /* atomic swapext */
/*
* Minimum and maximum sizes need for growth checks.
@@ -1205,6 +1205,8 @@ xfs_fs_geometry(
geo->flags |= XFS_FSOP_GEOM_FLAGS_REFLINK;
if (xfs_sb_version_hasbigtime(sbp))
geo->flags |= XFS_FSOP_GEOM_FLAGS_BIGTIME;
+ if (xfs_sb_version_hasatomicswap(sbp))
+ geo->flags |= XFS_FSOP_GEOM_FLAGS_ATOMIC_SWAP;
if (xfs_sb_version_hassector(sbp))
geo->logsectsize = sbp->sb_logsectsize;
else
@@ -1647,6 +1647,10 @@ xfs_fc_fill_super(
xfs_warn(mp,
"EXPERIMENTAL inode btree counters feature in use. Use at your own risk!");
+ if (xfs_sb_version_hasatomicswap(&mp->m_sb))
+ xfs_warn(mp,
+ "EXPERIMENTAL atomic file range swap feature in use. Use at your own risk!");
+
error = xfs_mountfs(mp);
if (error)
goto out_filestream_unmount;