diff options
author | Christoph Hellwig <hch@lst.de> | 2006-09-27 20:57:42 -0400 |
---|---|---|
committer | Tim Shimmin <tes@sgi.com> | 2006-09-27 20:57:42 -0400 |
commit | b113bcb83efb411f3cc6c7692fbf933ed01b67d8 (patch) | |
tree | 8b414cbdc2f8fdffbaa7a93e8e11d0d1679a5bc5 /fs/xfs/xfs_bmap_btree.c | |
parent | c38e5e84dbbeda9a92ea878ec9f6255b519a69e7 (diff) |
[XFS] add xfs_btree_check_lptr_disk variant which handles endian
conversion
SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26558a
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap_btree.c')
-rw-r--r-- | fs/xfs/xfs_bmap_btree.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 18fb7385d719..270cfe380504 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -382,7 +382,7 @@ xfs_bmbt_delrec( | |||
382 | pp = XFS_BMAP_PTR_IADDR(block, 1, cur); | 382 | pp = XFS_BMAP_PTR_IADDR(block, 1, cur); |
383 | #ifdef DEBUG | 383 | #ifdef DEBUG |
384 | for (i = ptr; i < numrecs; i++) { | 384 | for (i = ptr; i < numrecs; i++) { |
385 | if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i], ARCH_CONVERT), level))) { | 385 | if ((error = xfs_btree_check_lptr_disk(cur, pp[i], level))) { |
386 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 386 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
387 | goto error0; | 387 | goto error0; |
388 | } | 388 | } |
@@ -621,7 +621,7 @@ xfs_bmbt_delrec( | |||
621 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); | 621 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); |
622 | #ifdef DEBUG | 622 | #ifdef DEBUG |
623 | for (i = 0; i < numrrecs; i++) { | 623 | for (i = 0; i < numrrecs; i++) { |
624 | if ((error = xfs_btree_check_lptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))) { | 624 | if ((error = xfs_btree_check_lptr_disk(cur, rpp[i], level))) { |
625 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 625 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
626 | goto error0; | 626 | goto error0; |
627 | } | 627 | } |
@@ -858,7 +858,7 @@ xfs_bmbt_insrec( | |||
858 | pp = XFS_BMAP_PTR_IADDR(block, 1, cur); | 858 | pp = XFS_BMAP_PTR_IADDR(block, 1, cur); |
859 | #ifdef DEBUG | 859 | #ifdef DEBUG |
860 | for (i = numrecs; i >= ptr; i--) { | 860 | for (i = numrecs; i >= ptr; i--) { |
861 | if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i - 1], ARCH_CONVERT), | 861 | if ((error = xfs_btree_check_lptr_disk(cur, pp[i - 1], |
862 | level))) { | 862 | level))) { |
863 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 863 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
864 | return error; | 864 | return error; |
@@ -988,7 +988,7 @@ xfs_bmbt_killroot( | |||
988 | cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); | 988 | cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); |
989 | #ifdef DEBUG | 989 | #ifdef DEBUG |
990 | for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { | 990 | for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { |
991 | if ((error = xfs_btree_check_lptr(cur, INT_GET(cpp[i], ARCH_CONVERT), level - 1))) { | 991 | if ((error = xfs_btree_check_lptr_disk(cur, cpp[i], level - 1))) { |
992 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 992 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
993 | return error; | 993 | return error; |
994 | } | 994 | } |
@@ -1190,7 +1190,7 @@ xfs_bmbt_lookup( | |||
1190 | keyno = 1; | 1190 | keyno = 1; |
1191 | pp = XFS_BMAP_PTR_IADDR(block, keyno, cur); | 1191 | pp = XFS_BMAP_PTR_IADDR(block, keyno, cur); |
1192 | #ifdef DEBUG | 1192 | #ifdef DEBUG |
1193 | if ((error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), level))) { | 1193 | if ((error = xfs_btree_check_lptr_disk(cur, *pp, level))) { |
1194 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 1194 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
1195 | return error; | 1195 | return error; |
1196 | } | 1196 | } |
@@ -1313,7 +1313,7 @@ xfs_bmbt_lshift( | |||
1313 | lpp = XFS_BMAP_PTR_IADDR(left, lrecs, cur); | 1313 | lpp = XFS_BMAP_PTR_IADDR(left, lrecs, cur); |
1314 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); | 1314 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); |
1315 | #ifdef DEBUG | 1315 | #ifdef DEBUG |
1316 | if ((error = xfs_btree_check_lptr(cur, INT_GET(*rpp, ARCH_CONVERT), level))) { | 1316 | if ((error = xfs_btree_check_lptr_disk(cur, *rpp, level))) { |
1317 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 1317 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
1318 | return error; | 1318 | return error; |
1319 | } | 1319 | } |
@@ -1340,7 +1340,7 @@ xfs_bmbt_lshift( | |||
1340 | if (level > 0) { | 1340 | if (level > 0) { |
1341 | #ifdef DEBUG | 1341 | #ifdef DEBUG |
1342 | for (i = 0; i < rrecs; i++) { | 1342 | for (i = 0; i < rrecs; i++) { |
1343 | if ((error = xfs_btree_check_lptr(cur, INT_GET(rpp[i + 1], ARCH_CONVERT), | 1343 | if ((error = xfs_btree_check_lptr_disk(cur, rpp[i + 1], |
1344 | level))) { | 1344 | level))) { |
1345 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 1345 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
1346 | return error; | 1346 | return error; |
@@ -1445,7 +1445,7 @@ xfs_bmbt_rshift( | |||
1445 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); | 1445 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); |
1446 | #ifdef DEBUG | 1446 | #ifdef DEBUG |
1447 | for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { | 1447 | for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { |
1448 | if ((error = xfs_btree_check_lptr(cur, INT_GET(rpp[i], ARCH_CONVERT), level))) { | 1448 | if ((error = xfs_btree_check_lptr_disk(cur, rpp[i] level))) { |
1449 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 1449 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
1450 | return error; | 1450 | return error; |
1451 | } | 1451 | } |
@@ -1454,7 +1454,7 @@ xfs_bmbt_rshift( | |||
1454 | memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); | 1454 | memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); |
1455 | memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); | 1455 | memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); |
1456 | #ifdef DEBUG | 1456 | #ifdef DEBUG |
1457 | if ((error = xfs_btree_check_lptr(cur, INT_GET(*lpp, ARCH_CONVERT), level))) { | 1457 | if ((error = xfs_btree_check_lptr_disk(cur, *lpp, level))) { |
1458 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 1458 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
1459 | return error; | 1459 | return error; |
1460 | } | 1460 | } |
@@ -1619,7 +1619,7 @@ xfs_bmbt_split( | |||
1619 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); | 1619 | rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); |
1620 | #ifdef DEBUG | 1620 | #ifdef DEBUG |
1621 | for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { | 1621 | for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { |
1622 | if ((error = xfs_btree_check_lptr(cur, INT_GET(lpp[i], ARCH_CONVERT), level))) { | 1622 | if ((error = xfs_btree_check_lptr_disk(cur, lpp[i], level))) { |
1623 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 1623 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
1624 | return error; | 1624 | return error; |
1625 | } | 1625 | } |
@@ -2356,7 +2356,7 @@ xfs_bmbt_newroot( | |||
2356 | args.firstblock = args.fsbno; | 2356 | args.firstblock = args.fsbno; |
2357 | if (args.fsbno == NULLFSBLOCK) { | 2357 | if (args.fsbno == NULLFSBLOCK) { |
2358 | #ifdef DEBUG | 2358 | #ifdef DEBUG |
2359 | if ((error = xfs_btree_check_lptr(cur, INT_GET(*pp, ARCH_CONVERT), level))) { | 2359 | if ((error = xfs_btree_check_lptr_disk(cur, *pp, level))) { |
2360 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 2360 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
2361 | return error; | 2361 | return error; |
2362 | } | 2362 | } |
@@ -2393,7 +2393,7 @@ xfs_bmbt_newroot( | |||
2393 | cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); | 2393 | cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); |
2394 | #ifdef DEBUG | 2394 | #ifdef DEBUG |
2395 | for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { | 2395 | for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { |
2396 | if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i], ARCH_CONVERT), level))) { | 2396 | if ((error = xfs_btree_check_lptr_disk(cur, pp[i], level))) { |
2397 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); | 2397 | XFS_BMBT_TRACE_CURSOR(cur, ERROR); |
2398 | return error; | 2398 | return error; |
2399 | } | 2399 | } |