xfs
[Top] [All Lists]

[PATCH v2 03/17] xfs: define sparse inode chunks v5 sb feature bit and h

To: xfs@xxxxxxxxxxx
Subject: [PATCH v2 03/17] xfs: define sparse inode chunks v5 sb feature bit and helper function
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Mon, 3 Nov 2014 11:12:12 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1415031146-9107-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1415031146-9107-1-git-send-email-bfoster@xxxxxxxxxx>
The sparse inode chunks feature uses the helper function to enable the
allocation of sparse inode chunks. The incompatible feature bit is set
on disk at mkfs time.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 fs/xfs/libxfs/xfs_sb.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/xfs/libxfs/xfs_sb.h b/fs/xfs/libxfs/xfs_sb.h
index 4e5aaa8..eeb4058 100644
--- a/fs/xfs/libxfs/xfs_sb.h
+++ b/fs/xfs/libxfs/xfs_sb.h
@@ -509,6 +509,7 @@ xfs_sb_has_ro_compat_feature(
 }
 
 #define XFS_SB_FEAT_INCOMPAT_FTYPE     (1 << 0)        /* filetype in dirent */
+#define XFS_SB_FEAT_INCOMPAT_SPINODES  (1 << 1)        /* sparse inode chunks 
*/
 #define XFS_SB_FEAT_INCOMPAT_ALL \
                (XFS_SB_FEAT_INCOMPAT_FTYPE)
 
@@ -558,6 +559,12 @@ static inline int xfs_sb_version_hasfinobt(xfs_sb_t *sbp)
                (sbp->sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_FINOBT);
 }
 
+static inline bool xfs_sb_version_hassparseinodes(struct xfs_sb *sbp)
+{
+       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
+               xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_SPINODES);
+}
+
 /*
  * end of superblock version macros
  */
-- 
1.8.3.1

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