aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 01:54:33 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 01:54:33 -0400
commite99ab90d6a9e8ac92f05d2c31d44aa7feee15394 (patch)
tree49f96f06100aae711eafe75799c4812a001a51ba
parent8186e517fab1854554c48955cdbcbb6710e7baef (diff)
[XFS] add a long pointers flag to xfs_btree_cur
Add a flag to the xfs btree cursor when using long (64bit) block pointers instead of checking btnum == XFS_BTNUM_BMAP. SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32181a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Bill O'Donnell <billodo@sgi.com> Signed-off-by: David Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/xfs_bmap_btree.c2
-rw-r--r--fs/xfs/xfs_btree.c6
-rw-r--r--fs/xfs/xfs_btree.h6
3 files changed, 5 insertions, 9 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index d9bbed676e0c..1ec494e111b5 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -2656,7 +2656,7 @@ xfs_bmbt_init_cursor(
2656 cur->bc_blocklog = mp->m_sb.sb_blocklog; 2656 cur->bc_blocklog = mp->m_sb.sb_blocklog;
2657 2657
2658 cur->bc_ops = &xfs_bmbt_ops; 2658 cur->bc_ops = &xfs_bmbt_ops;
2659 cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; 2659 cur->bc_flags = XFS_BTREE_LONG_PTRS | XFS_BTREE_ROOT_IN_INODE;
2660 2660
2661 cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); 2661 cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork);
2662 cur->bc_private.b.ip = ip; 2662 cur->bc_private.b.ip = ip;
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c
index 57e858fbf683..59796b42e9c4 100644
--- a/fs/xfs/xfs_btree.c
+++ b/fs/xfs/xfs_btree.c
@@ -90,7 +90,7 @@ xfs_btree_check_block(
90 int level, /* level of the btree block */ 90 int level, /* level of the btree block */
91 xfs_buf_t *bp) /* buffer containing block, if any */ 91 xfs_buf_t *bp) /* buffer containing block, if any */
92{ 92{
93 if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) 93 if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
94 xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, 94 xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level,
95 bp); 95 bp);
96 else 96 else
@@ -516,7 +516,7 @@ xfs_btree_islastblock(
516 516
517 block = xfs_btree_get_block(cur, level, &bp); 517 block = xfs_btree_get_block(cur, level, &bp);
518 xfs_btree_check_block(cur, block, level, bp); 518 xfs_btree_check_block(cur, block, level, bp);
519 if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) 519 if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
520 return be64_to_cpu(block->bb_u.l.bb_rightsib) == NULLDFSBNO; 520 return be64_to_cpu(block->bb_u.l.bb_rightsib) == NULLDFSBNO;
521 else 521 else
522 return be32_to_cpu(block->bb_u.s.bb_rightsib) == NULLAGBLOCK; 522 return be32_to_cpu(block->bb_u.s.bb_rightsib) == NULLAGBLOCK;
@@ -808,7 +808,7 @@ xfs_btree_setbuf(
808 if (!bp) 808 if (!bp)
809 return; 809 return;
810 b = XFS_BUF_TO_BLOCK(bp); 810 b = XFS_BUF_TO_BLOCK(bp);
811 if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) { 811 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
812 if (be64_to_cpu(b->bb_u.l.bb_leftsib) == NULLDFSBNO) 812 if (be64_to_cpu(b->bb_u.l.bb_leftsib) == NULLDFSBNO)
813 cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA; 813 cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA;
814 if (be64_to_cpu(b->bb_u.l.bb_rightsib) == NULLDFSBNO) 814 if (be64_to_cpu(b->bb_u.l.bb_rightsib) == NULLDFSBNO)
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h
index fefbc69e500e..dd93fd39c56a 100644
--- a/fs/xfs/xfs_btree.h
+++ b/fs/xfs/xfs_btree.h
@@ -116,11 +116,6 @@ union xfs_btree_rec {
116#define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1) 116#define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1)
117 117
118/* 118/*
119 * Boolean to select which form of xfs_btree_block_t.bb_u to use.
120 */
121#define XFS_BTREE_LONG_PTRS(btnum) ((btnum) == XFS_BTNUM_BMAP)
122
123/*
124 * Magic numbers for btree blocks. 119 * Magic numbers for btree blocks.
125 */ 120 */
126extern const __uint32_t xfs_magics[]; 121extern const __uint32_t xfs_magics[];
@@ -203,6 +198,7 @@ typedef struct xfs_btree_cur
203} xfs_btree_cur_t; 198} xfs_btree_cur_t;
204 199
205/* cursor flags */ 200/* cursor flags */
201#define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */
206#define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ 202#define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */
207 203
208 204