xfs: add reflink feature flag to geometry
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 3 Oct 2016 16:11:30 +0000 (09:11 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 5 Oct 2016 01:06:40 +0000 (18:06 -0700)
Report the reflink feature in the XFS geometry so that xfs_info and
friends know the filesystem has this feature.

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

index 79455058b752588e7855afde61ad59ba4ce3186f..6f4f2c3d7774b1463440aa8a75abaceafda699d1 100644 (file)
@@ -206,7 +206,8 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_FTYPE      0x10000 /* inode directory types */
 #define XFS_FSOP_GEOM_FLAGS_FINOBT     0x20000 /* free inode btree */
 #define XFS_FSOP_GEOM_FLAGS_SPINODES   0x40000 /* sparse inode chunks  */
-#define XFS_FSOP_GEOM_FLAGS_RMAPBT     0x80000 /* Reverse mapping btree */
+#define XFS_FSOP_GEOM_FLAGS_RMAPBT     0x80000 /* reverse mapping btree */
+#define XFS_FSOP_GEOM_FLAGS_REFLINK    0x100000 /* files can share blocks */
 
 /*
  * Minimum and maximum sizes need for growth checks.
index 4b4059b5e50194d34f60fda5bba4b01504b13719..3acbf4e03187a34e71b42d299a8f4eac1ab18dc5 100644 (file)
@@ -108,7 +108,9 @@ xfs_fs_geometry(
                        (xfs_sb_version_hassparseinodes(&mp->m_sb) ?
                                XFS_FSOP_GEOM_FLAGS_SPINODES : 0) |
                        (xfs_sb_version_hasrmapbt(&mp->m_sb) ?
-                               XFS_FSOP_GEOM_FLAGS_RMAPBT : 0);
+                               XFS_FSOP_GEOM_FLAGS_RMAPBT : 0) |
+                       (xfs_sb_version_hasreflink(&mp->m_sb) ?
+                               XFS_FSOP_GEOM_FLAGS_REFLINK : 0);
                geo->logsectsize = xfs_sb_version_hassector(&mp->m_sb) ?
                                mp->m_sb.sb_logsectsize : BBSIZE;
                geo->rtsectsize = mp->m_sb.sb_blocksize;