aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_btree.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 02:11:40 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:11:40 -0400
commit136341b41ad4883bd668120f727a52c42331fe8a (patch)
tree0cb1b220073948f2632911354a828606a9e276bb /fs/xfs/xfs_bmap_btree.c
parent6c7699c047c50403149ad91331dd39de47dea070 (diff)
[XFS] cleanup btree record / key / ptr addressing macros.
Replace the generic record / key / ptr addressing macros that use cpp token pasting with simpler macros that do the job for just one given btree type. The new macros lose the cur argument and thus can be used outside the core btree code, but also gain an xfs_mount * argument to allow for checking the CRC flag in the near future. Note that many of these macros aren't actually used in the kernel code, but only in userspace (mostly in xfs_repair). SGI-PV: 988146 SGI-Modid: xfs-linux-melb:xfs-kern:32295a 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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 853828c6b45e..11137c042c94 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -44,7 +44,6 @@
44#include "xfs_error.h" 44#include "xfs_error.h"
45#include "xfs_quota.h" 45#include "xfs_quota.h"
46 46
47
48/* 47/*
49 * Determine the extent state. 48 * Determine the extent state.
50 */ 49 */
@@ -85,9 +84,9 @@ xfs_bmdr_to_bmbt(
85 rblock->bb_leftsib = cpu_to_be64(NULLDFSBNO); 84 rblock->bb_leftsib = cpu_to_be64(NULLDFSBNO);
86 rblock->bb_rightsib = cpu_to_be64(NULLDFSBNO); 85 rblock->bb_rightsib = cpu_to_be64(NULLDFSBNO);
87 dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0); 86 dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0);
88 fkp = XFS_BTREE_KEY_ADDR(xfs_bmdr, dblock, 1); 87 fkp = XFS_BMDR_KEY_ADDR(dblock, 1);
89 tkp = XFS_BMAP_BROOT_KEY_ADDR(rblock, 1, rblocklen); 88 tkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1);
90 fpp = XFS_BTREE_PTR_ADDR(xfs_bmdr, dblock, 1, dmxr); 89 fpp = XFS_BMDR_PTR_ADDR(dblock, 1, dmxr);
91 tpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen); 90 tpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen);
92 dmxr = be16_to_cpu(dblock->bb_numrecs); 91 dmxr = be16_to_cpu(dblock->bb_numrecs);
93 memcpy(tkp, fkp, sizeof(*fkp) * dmxr); 92 memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
@@ -448,10 +447,10 @@ xfs_bmbt_to_bmdr(
448 dblock->bb_level = rblock->bb_level; 447 dblock->bb_level = rblock->bb_level;
449 dblock->bb_numrecs = rblock->bb_numrecs; 448 dblock->bb_numrecs = rblock->bb_numrecs;
450 dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0); 449 dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0);
451 fkp = XFS_BMAP_BROOT_KEY_ADDR(rblock, 1, rblocklen); 450 fkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1);
452 tkp = XFS_BTREE_KEY_ADDR(xfs_bmdr, dblock, 1); 451 tkp = XFS_BMDR_KEY_ADDR(dblock, 1);
453 fpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen); 452 fpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen);
454 tpp = XFS_BTREE_PTR_ADDR(xfs_bmdr, dblock, 1, dmxr); 453 tpp = XFS_BMDR_PTR_ADDR(dblock, 1, dmxr);
455 dmxr = be16_to_cpu(dblock->bb_numrecs); 454 dmxr = be16_to_cpu(dblock->bb_numrecs);
456 memcpy(tkp, fkp, sizeof(*fkp) * dmxr); 455 memcpy(tkp, fkp, sizeof(*fkp) * dmxr);
457 memcpy(tpp, fpp, sizeof(*fpp) * dmxr); 456 memcpy(tpp, fpp, sizeof(*fpp) * dmxr);