diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-10-30 02:14:34 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@sgi.com> | 2008-10-30 02:14:34 -0400 |
commit | 7cc95a821df8f09a5d37a923cf8c3a7c3ee00c29 (patch) | |
tree | 8fde02d4c9a52b7da7b3e961f8a23cf4b493a4a4 /fs/xfs/xfs_bmap_btree.c | |
parent | 136341b41ad4883bd668120f727a52c42331fe8a (diff) |
[XFS] Always use struct xfs_btree_block instead of short / longform
structures.
Always use the generic xfs_btree_block type instead of the short / long
structures. Add XFS_BTREE_SBLOCK_LEN / XFS_BTREE_LBLOCK_LEN defines for
the length of a short / long form block. The rationale for this is that we
will grow more btree block header variants to support CRCs and other RAS
information, and always accessing them through the same datatype with
unions for the short / long form pointers makes implementing this much
easier.
SGI-PV: 988146
SGI-Modid: xfs-linux-melb:xfs-kern:32300a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Donald Douwsma <donaldd@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap_btree.c')
-rw-r--r-- | fs/xfs/xfs_bmap_btree.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 11137c042c94..e46e02b8e277 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -68,7 +68,7 @@ xfs_bmdr_to_bmbt( | |||
68 | struct xfs_mount *mp, | 68 | struct xfs_mount *mp, |
69 | xfs_bmdr_block_t *dblock, | 69 | xfs_bmdr_block_t *dblock, |
70 | int dblocklen, | 70 | int dblocklen, |
71 | xfs_bmbt_block_t *rblock, | 71 | struct xfs_btree_block *rblock, |
72 | int rblocklen) | 72 | int rblocklen) |
73 | { | 73 | { |
74 | int dmxr; | 74 | int dmxr; |
@@ -81,8 +81,8 @@ xfs_bmdr_to_bmbt( | |||
81 | rblock->bb_level = dblock->bb_level; | 81 | rblock->bb_level = dblock->bb_level; |
82 | ASSERT(be16_to_cpu(rblock->bb_level) > 0); | 82 | ASSERT(be16_to_cpu(rblock->bb_level) > 0); |
83 | rblock->bb_numrecs = dblock->bb_numrecs; | 83 | rblock->bb_numrecs = dblock->bb_numrecs; |
84 | rblock->bb_leftsib = cpu_to_be64(NULLDFSBNO); | 84 | rblock->bb_u.l.bb_leftsib = cpu_to_be64(NULLDFSBNO); |
85 | rblock->bb_rightsib = cpu_to_be64(NULLDFSBNO); | 85 | rblock->bb_u.l.bb_rightsib = cpu_to_be64(NULLDFSBNO); |
86 | dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0); | 86 | dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0); |
87 | fkp = XFS_BMDR_KEY_ADDR(dblock, 1); | 87 | fkp = XFS_BMDR_KEY_ADDR(dblock, 1); |
88 | tkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1); | 88 | tkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1); |
@@ -429,7 +429,7 @@ xfs_bmbt_set_state( | |||
429 | void | 429 | void |
430 | xfs_bmbt_to_bmdr( | 430 | xfs_bmbt_to_bmdr( |
431 | struct xfs_mount *mp, | 431 | struct xfs_mount *mp, |
432 | xfs_bmbt_block_t *rblock, | 432 | struct xfs_btree_block *rblock, |
433 | int rblocklen, | 433 | int rblocklen, |
434 | xfs_bmdr_block_t *dblock, | 434 | xfs_bmdr_block_t *dblock, |
435 | int dblocklen) | 435 | int dblocklen) |
@@ -441,8 +441,8 @@ xfs_bmbt_to_bmdr( | |||
441 | __be64 *tpp; | 441 | __be64 *tpp; |
442 | 442 | ||
443 | ASSERT(be32_to_cpu(rblock->bb_magic) == XFS_BMAP_MAGIC); | 443 | ASSERT(be32_to_cpu(rblock->bb_magic) == XFS_BMAP_MAGIC); |
444 | ASSERT(be64_to_cpu(rblock->bb_leftsib) == NULLDFSBNO); | 444 | ASSERT(be64_to_cpu(rblock->bb_u.l.bb_leftsib) == NULLDFSBNO); |
445 | ASSERT(be64_to_cpu(rblock->bb_rightsib) == NULLDFSBNO); | 445 | ASSERT(be64_to_cpu(rblock->bb_u.l.bb_rightsib) == NULLDFSBNO); |
446 | ASSERT(be16_to_cpu(rblock->bb_level) > 0); | 446 | ASSERT(be16_to_cpu(rblock->bb_level) > 0); |
447 | dblock->bb_level = rblock->bb_level; | 447 | dblock->bb_level = rblock->bb_level; |
448 | dblock->bb_numrecs = rblock->bb_numrecs; | 448 | dblock->bb_numrecs = rblock->bb_numrecs; |
@@ -906,7 +906,7 @@ xfs_bmbt_maxrecs( | |||
906 | int blocklen, | 906 | int blocklen, |
907 | int leaf) | 907 | int leaf) |
908 | { | 908 | { |
909 | blocklen -= sizeof(struct xfs_btree_lblock); | 909 | blocklen -= XFS_BMBT_BLOCK_LEN(mp); |
910 | 910 | ||
911 | if (leaf) | 911 | if (leaf) |
912 | return blocklen / sizeof(xfs_bmbt_rec_t); | 912 | return blocklen / sizeof(xfs_bmbt_rec_t); |