diff mbox

[16/18] xfs: use a b+tree for the in-core extent list

Message ID 20171102001627.GO4911@magnolia (mailing list archive)
State Superseded
Headers show

Commit Message

Darrick J. Wong Nov. 2, 2017, 12:16 a.m. UTC
FWIW the attached crap patch fixes all the fstests failures I saw.

--D

---
 fs/xfs/libxfs/xfs_iext_tree.c |   21 ++++++++++++---------
 fs/xfs/xfs_trace.h            |    1 +
 2 files changed, 13 insertions(+), 9 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Christoph Hellwig Nov. 2, 2017, 6:03 a.m. UTC | #1
On Wed, Nov 01, 2017 at 05:16:27PM -0700, Darrick J. Wong wrote:
> FWIW the attached crap patch fixes all the fstests failures I saw.

Thanks, I'll take a look.  Been a little busy finishing off another
large non-xfs patchset and preparing a conference talk all at the same
time..
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/libxfs/xfs_iext_tree.c b/fs/xfs/libxfs/xfs_iext_tree.c
index c18d344..2aa5651 100644
--- a/fs/xfs/libxfs/xfs_iext_tree.c
+++ b/fs/xfs/libxfs/xfs_iext_tree.c
@@ -28,17 +28,17 @@ 
  * In-core extent record layout:
  *
  * +-------+----------------------------+
- * | 00:51 | all 52 bits of startoff    |
- * | 52:63 | low 12 bits of startblock  |
+ * | 00:53 | all 54 bits of startoff    |
+ * | 54:63 | low 10 bits of startblock  |
  * +-------+----------------------------+
  * | 00:20 | all 21 bits of length      |
  * |    21 | unwritten extent bit       |
  * | 22:63 | high 42 bits of startblock |
  * +-------+----------------------------+
  */
-#define XFS_IEXT_STARTOFF_MASK		xfs_mask64lo(52)
-#define XFS_IEXT_LENGTH_MASK		xfs_mask64lo(21)
-#define XFS_IEXT_STARTBLOCK_MASK	xfs_mask64lo(54)
+#define XFS_IEXT_STARTOFF_MASK		xfs_mask64lo(BMBT_STARTOFF_BITLEN)
+#define XFS_IEXT_LENGTH_MASK		xfs_mask64lo(BMBT_BLOCKCOUNT_BITLEN)
+#define XFS_IEXT_STARTBLOCK_MASK	xfs_mask64lo(BMBT_STARTBLOCK_BITLEN)
 
 struct xfs_iext_rec {
 	uint64_t			lo;
@@ -72,8 +74,8 @@  xfs_iext_set(
 	rec->lo = irec->br_startoff & XFS_IEXT_STARTOFF_MASK;
 	rec->hi = irec->br_blockcount & XFS_IEXT_LENGTH_MASK;
 
-	rec->lo |= (irec->br_startblock << 52);
-	rec->hi |= ((irec->br_startblock & ~xfs_mask64lo(12)) << (22 - 12));
+	rec->lo |= (irec->br_startblock << 54);
+	rec->hi |= ((irec->br_startblock & ~xfs_mask64lo(10)) << (22 - 10));
 
 	if (irec->br_state == XFS_EXT_UNWRITTEN)
 		rec->hi |= (1 << 21);
@@ -87,8 +89,8 @@  xfs_iext_get(
 	irec->br_startoff = rec->lo & XFS_IEXT_STARTOFF_MASK;
 	irec->br_blockcount = rec->hi & XFS_IEXT_LENGTH_MASK;
 
-	irec->br_startblock = rec->lo >> 52;
-	irec->br_startblock |= (rec->hi & xfs_mask64hi(42)) >> (22 - 12);
+	irec->br_startblock = rec->lo >> 54;
+	irec->br_startblock |= (rec->hi & xfs_mask64hi(42)) >> (22 - 10);
 
 	if (rec->hi & (1 << 21))
 		irec->br_state = XFS_EXT_UNWRITTEN;