]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xfs: recognize the reflink feature bit
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 3 Oct 2016 16:11:52 +0000 (09:11 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 5 Oct 2016 23:26:31 +0000 (16:26 -0700)
Add the reflink feature flag to the set of recognized feature flags.
This enables users to write to reflink filesystems.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_format.h
fs/xfs/xfs_super.c

index 5e04ea2aa902c5f061f5bf4289c4b1cd701d67be..f6547fc5e016e75a130a738c3e4a1b3a087d7281 100644 (file)
@@ -459,7 +459,8 @@ xfs_sb_has_compat_feature(
 #define XFS_SB_FEAT_RO_COMPAT_REFLINK  (1 << 2)                /* reflinked files */
 #define XFS_SB_FEAT_RO_COMPAT_ALL \
                (XFS_SB_FEAT_RO_COMPAT_FINOBT | \
-                XFS_SB_FEAT_RO_COMPAT_RMAPBT)
+                XFS_SB_FEAT_RO_COMPAT_RMAPBT | \
+                XFS_SB_FEAT_RO_COMPAT_REFLINK)
 #define XFS_SB_FEAT_RO_COMPAT_UNKNOWN  ~XFS_SB_FEAT_RO_COMPAT_ALL
 static inline bool
 xfs_sb_has_ro_compat_feature(
index 15b9fcd16c675c5341f34538076e9aa68fe2a65f..72bde2811bd7e58723b22710bbf45116bc134dac 100644 (file)
@@ -1614,6 +1614,9 @@ xfs_fs_fill_super(
                        "DAX unsupported by block device. Turning off DAX.");
                        mp->m_flags &= ~XFS_MOUNT_DAX;
                }
+               if (xfs_sb_version_hasreflink(&mp->m_sb))
+                       xfs_alert(mp,
+               "DAX and reflink have not been tested together!");
        }
 
        if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
@@ -1627,6 +1630,10 @@ xfs_fs_fill_super(
        "EXPERIMENTAL reverse mapping btree feature enabled. Use at your own risk!");
        }
 
+       if (xfs_sb_version_hasreflink(&mp->m_sb))
+               xfs_alert(mp,
+       "EXPERIMENTAL reflink feature enabled. Use at your own risk!");
+
        error = xfs_mountfs(mp);
        if (error)
                goto out_filestream_unmount;