xfs
[Top] [All Lists]

[PATCH v5 07/18] xfs: add fs geometry bit for sparse inode chunks

To: xfs@xxxxxxxxxxx
Subject: [PATCH v5 07/18] xfs: add fs geometry bit for sparse inode chunks
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Thu, 19 Feb 2015 13:13:32 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1424369623-5656-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1424369623-5656-1-git-send-email-bfoster@xxxxxxxxxx>
Define an fs geometry bit for sparse inode chunks such that the
characteristic of the fs can be identified by userspace.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 fs/xfs/libxfs/xfs_fs.h | 1 +
 fs/xfs/xfs_fsops.c     | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h
index 18dc721..89689c6 100644
--- a/fs/xfs/libxfs/xfs_fs.h
+++ b/fs/xfs/libxfs/xfs_fs.h
@@ -239,6 +239,7 @@ typedef struct xfs_fsop_resblks {
 #define XFS_FSOP_GEOM_FLAGS_V5SB       0x8000  /* version 5 superblock */
 #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  */
 
 /*
  * Minimum and maximum sizes need for growth checks.
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 74efe5b..8c18da9 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -101,7 +101,9 @@ xfs_fs_geometry(
                        (xfs_sb_version_hasftype(&mp->m_sb) ?
                                XFS_FSOP_GEOM_FLAGS_FTYPE : 0) |
                        (xfs_sb_version_hasfinobt(&mp->m_sb) ?
-                               XFS_FSOP_GEOM_FLAGS_FINOBT : 0);
+                               XFS_FSOP_GEOM_FLAGS_FINOBT : 0) |
+                       (xfs_sb_version_hassparseinodes(&mp->m_sb) ?
+                               XFS_FSOP_GEOM_FLAGS_SPINODES : 0);
                geo->logsectsize = xfs_sb_version_hassector(&mp->m_sb) ?
                                mp->m_sb.sb_logsectsize : BBSIZE;
                geo->rtsectsize = mp->m_sb.sb_blocksize;
-- 
1.9.3

<Prev in Thread] Current Thread [Next in Thread>