xfs
[Top] [All Lists]

[RFC 04/17] xfs: (parent ptr) add parent pointer support to xfs_sb.h

To: xfs@xxxxxxxxxxx
Subject: [RFC 04/17] xfs: (parent ptr) add parent pointer support to xfs_sb.h
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Wed, 15 Jan 2014 16:00:16 -0600
Delivered-to: xfs@xxxxxxxxxxx
References: <20140115220012.624438534@xxxxxxx>
User-agent: quilt/0.51-1
Add the parent pointer support to the superblock version 5.

---
 fs/xfs/xfs_sb.h |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Index: b/fs/xfs/xfs_sb.h
===================================================================
--- a/fs/xfs/xfs_sb.h
+++ b/fs/xfs/xfs_sb.h
@@ -89,6 +89,7 @@ struct xfs_trans;
 #define        XFS_SB_VERSION2_OKREALFBITS     \
        (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \
         XFS_SB_VERSION2_ATTR2BIT       | \
+        XFS_SB_VERSION2_PARENTBIT      | \
         XFS_SB_VERSION2_PROJID32BIT    | \
         XFS_SB_VERSION2_FTYPE)
 #define        XFS_SB_VERSION2_OKSASHFBITS     \
@@ -596,8 +597,10 @@ xfs_sb_has_ro_compat_feature(
 }
 
 #define XFS_SB_FEAT_INCOMPAT_FTYPE     (1 << 0)        /* filetype in dirent */
+#define XFS_SB_FEAT_INCOMPAT_PARENT    (2 << 0)        /* parent inode ptr */
 #define XFS_SB_FEAT_INCOMPAT_ALL \
-               (XFS_SB_FEAT_INCOMPAT_FTYPE)
+               (XFS_SB_FEAT_INCOMPAT_FTYPE | \
+                XFS_SB_FEAT_INCOMPAT_PARENT)
 
 #define XFS_SB_FEAT_INCOMPAT_UNKNOWN   ~XFS_SB_FEAT_INCOMPAT_ALL
 static inline bool
@@ -639,6 +642,12 @@ static inline int xfs_sb_version_hasftyp
                 (sbp->sb_features2 & XFS_SB_VERSION2_FTYPE));
 }
 
+static inline int xfs_sb_version_hasparent(struct xfs_sb *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
+               xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_PARENT));
+}
+
 /*
  * end of superblock version macros
  */


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