summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_format.h
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2014-05-15 09:37:44 +1000
committerDave Chinner <david@fromorbit.com>2014-05-15 09:37:44 +1000
commitb76769294ba400415fc44038c21cc2df86f9a28b (patch)
treea1ca6152391c86ae024e09d69e7b0ad75a5c61d5 /fs/xfs/xfs_format.h
parent232c2f5c65dd80055e7163a5c82e3816119330e6 (diff)
parent53801fd97ae000793f51187b122b9475102199a8 (diff)
downloadlwn-b76769294ba400415fc44038c21cc2df86f9a28b.tar.gz
lwn-b76769294ba400415fc44038c21cc2df86f9a28b.zip
Merge branch 'xfs-free-inode-btree' into for-next
Diffstat (limited to 'fs/xfs/xfs_format.h')
-rw-r--r--fs/xfs/xfs_format.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/xfs/xfs_format.h b/fs/xfs/xfs_format.h
index 9898f31d05d8..34d85aca3058 100644
--- a/fs/xfs/xfs_format.h
+++ b/fs/xfs/xfs_format.h
@@ -202,6 +202,8 @@ typedef __be32 xfs_alloc_ptr_t;
*/
#define XFS_IBT_MAGIC 0x49414254 /* 'IABT' */
#define XFS_IBT_CRC_MAGIC 0x49414233 /* 'IAB3' */
+#define XFS_FIBT_MAGIC 0x46494254 /* 'FIBT' */
+#define XFS_FIBT_CRC_MAGIC 0x46494233 /* 'FIB3' */
typedef __uint64_t xfs_inofree_t;
#define XFS_INODES_PER_CHUNK (NBBY * sizeof(xfs_inofree_t))
@@ -244,7 +246,17 @@ typedef __be32 xfs_inobt_ptr_t;
* block numbers in the AG.
*/
#define XFS_IBT_BLOCK(mp) ((xfs_agblock_t)(XFS_CNT_BLOCK(mp) + 1))
-#define XFS_PREALLOC_BLOCKS(mp) ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
+#define XFS_FIBT_BLOCK(mp) ((xfs_agblock_t)(XFS_IBT_BLOCK(mp) + 1))
+
+/*
+ * The first data block of an AG depends on whether the filesystem was formatted
+ * with the finobt feature. If so, account for the finobt reserved root btree
+ * block.
+ */
+#define XFS_PREALLOC_BLOCKS(mp) \
+ (xfs_sb_version_hasfinobt(&((mp)->m_sb)) ? \
+ XFS_FIBT_BLOCK(mp) + 1 : \
+ XFS_IBT_BLOCK(mp) + 1)