summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_btree.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-16 16:24:15 +1000
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 16:26:44 +1000
commitcd8b0a97bd9216578a44a9bf82188cd901295964 (patch)
tree36ae580e2f8b1e05747a387c50b852db7f929798 /fs/xfs/xfs_bmap_btree.c
parente05596643d4bb5ab7d813d1ac5724178ca4c7134 (diff)
downloadblackbird-op-linux-cd8b0a97bd9216578a44a9bf82188cd901295964.tar.gz
blackbird-op-linux-cd8b0a97bd9216578a44a9bf82188cd901295964.zip
[XFS] endianess annotations for xfs_bmbt_rec_t
SGI-PV: 968563 SGI-Modid: xfs-linux-melb:xfs-kern:29321a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@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.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index abe35553969b..41092a2ea917 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -1914,19 +1914,13 @@ xfs_bmbt_get_state(
ext_flag);
}
-#ifndef XFS_NATIVE_HOST
/* Endian flipping versions of the bmbt extraction functions */
void
xfs_bmbt_disk_get_all(
xfs_bmbt_rec_t *r,
xfs_bmbt_irec_t *s)
{
- __uint64_t l0, l1;
-
- l0 = INT_GET(r->l0, ARCH_CONVERT);
- l1 = INT_GET(r->l1, ARCH_CONVERT);
-
- __xfs_bmbt_get_all(l0, l1, s);
+ __xfs_bmbt_get_all(be64_to_cpu(r->l0), be64_to_cpu(r->l1), s);
}
/*
@@ -1936,7 +1930,7 @@ xfs_filblks_t
xfs_bmbt_disk_get_blockcount(
xfs_bmbt_rec_t *r)
{
- return (xfs_filblks_t)(INT_GET(r->l1, ARCH_CONVERT) & XFS_MASK64LO(21));
+ return (xfs_filblks_t)(be64_to_cpu(r->l1) & XFS_MASK64LO(21));
}
/*
@@ -1946,11 +1940,9 @@ xfs_fileoff_t
xfs_bmbt_disk_get_startoff(
xfs_bmbt_rec_t *r)
{
- return ((xfs_fileoff_t)INT_GET(r->l0, ARCH_CONVERT) &
+ return ((xfs_fileoff_t)be64_to_cpu(r->l0) &
XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
}
-#endif /* XFS_NATIVE_HOST */
-
/*
* Increment cursor by one record at the level.
@@ -2348,7 +2340,6 @@ xfs_bmbt_set_all(
}
-#ifndef XFS_NATIVE_HOST
/*
* Set all the fields in a disk format bmap extent record from the arguments.
*/
@@ -2369,29 +2360,29 @@ xfs_bmbt_disk_set_allf(
#if XFS_BIG_BLKNOS
ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0);
- INT_SET(r->l0, ARCH_CONVERT,
+ r->l0 = cpu_to_be64(
((xfs_bmbt_rec_base_t)extent_flag << 63) |
((xfs_bmbt_rec_base_t)startoff << 9) |
((xfs_bmbt_rec_base_t)startblock >> 43));
- INT_SET(r->l1, ARCH_CONVERT,
+ r->l1 = cpu_to_be64(
((xfs_bmbt_rec_base_t)startblock << 21) |
((xfs_bmbt_rec_base_t)blockcount &
(xfs_bmbt_rec_base_t)XFS_MASK64LO(21)));
#else /* !XFS_BIG_BLKNOS */
if (ISNULLSTARTBLOCK(b)) {
- INT_SET(r->l0, ARCH_CONVERT,
+ r->l0 = cpu_to_be64(
((xfs_bmbt_rec_base_t)extent_flag << 63) |
((xfs_bmbt_rec_base_t)startoff << 9) |
(xfs_bmbt_rec_base_t)XFS_MASK64LO(9));
- INT_SET(r->l1, ARCH_CONVERT, XFS_MASK64HI(11) |
+ r->l1 = cpu_to_be64(XFS_MASK64HI(11) |
((xfs_bmbt_rec_base_t)startblock << 21) |
((xfs_bmbt_rec_base_t)blockcount &
(xfs_bmbt_rec_base_t)XFS_MASK64LO(21)));
} else {
- INT_SET(r->l0, ARCH_CONVERT,
+ r->l0 = cpu_to_be64(
((xfs_bmbt_rec_base_t)extent_flag << 63) |
((xfs_bmbt_rec_base_t)startoff << 9));
- INT_SET(r->l1, ARCH_CONVERT,
+ r->l1 = cpu_to_be64(
((xfs_bmbt_rec_base_t)startblock << 21) |
((xfs_bmbt_rec_base_t)blockcount &
(xfs_bmbt_rec_base_t)XFS_MASK64LO(21)));
@@ -2410,7 +2401,6 @@ xfs_bmbt_disk_set_all(
xfs_bmbt_disk_set_allf(r, s->br_startoff, s->br_startblock,
s->br_blockcount, s->br_state);
}
-#endif /* XFS_NATIVE_HOST */
/*
* Set the blockcount field in a bmap extent record.
OpenPOWER on IntegriCloud