diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-16 02:23:40 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 02:25:51 -0400 |
commit | a6f64d4aea0d0c8483e910c7dd2d1ee48e42245c (patch) | |
tree | f3fb20bb6d816f6d674bd4c8bfa687b013443eaf /fs/xfs/xfs_bmap_btree.c | |
parent | d580ef6eaae6eaaef1e06c7d689fc9949faee9da (diff) |
[XFS] split ondisk vs incore versions of xfs_bmbt_rec_t
currently xfs_bmbt_rec_t is used both for ondisk extents as well as
host-endian ones. This patch adds a new xfs_bmbt_rec_host_t for the native
endian ones and cleans up the fallout. There have been various endianess
issues in the tracing / debug printf code that are fixed by this patch.
SGI-PV: 968563
SGI-Modid: xfs-linux-melb:xfs-kern:29318a
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.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c index 08184cc399be..e54c71e20e0e 100644 --- a/fs/xfs/xfs_bmap_btree.c +++ b/fs/xfs/xfs_bmap_btree.c | |||
@@ -260,13 +260,14 @@ xfs_bmbt_trace_cursor( | |||
260 | char *s, | 260 | char *s, |
261 | int line) | 261 | int line) |
262 | { | 262 | { |
263 | xfs_bmbt_rec_t r; | 263 | xfs_bmbt_rec_host_t r; |
264 | 264 | ||
265 | xfs_bmbt_set_all(&r, &cur->bc_rec.b); | 265 | xfs_bmbt_set_all(&r, &cur->bc_rec.b); |
266 | xfs_bmbt_trace_enter(func, cur, s, XFS_BMBT_KTRACE_CUR, line, | 266 | xfs_bmbt_trace_enter(func, cur, s, XFS_BMBT_KTRACE_CUR, line, |
267 | (cur->bc_nlevels << 24) | (cur->bc_private.b.flags << 16) | | 267 | (cur->bc_nlevels << 24) | (cur->bc_private.b.flags << 16) | |
268 | cur->bc_private.b.allocated, | 268 | cur->bc_private.b.allocated, |
269 | INT_GET(r.l0, ARCH_CONVERT) >> 32, (int)INT_GET(r.l0, ARCH_CONVERT), INT_GET(r.l1, ARCH_CONVERT) >> 32, (int)INT_GET(r.l1, ARCH_CONVERT), | 269 | r.l0 >> 32, (int)r.l0, |
270 | r.l1 >> 32, (int)r.l1, | ||
270 | (unsigned long)cur->bc_bufs[0], (unsigned long)cur->bc_bufs[1], | 271 | (unsigned long)cur->bc_bufs[0], (unsigned long)cur->bc_bufs[1], |
271 | (unsigned long)cur->bc_bufs[2], (unsigned long)cur->bc_bufs[3], | 272 | (unsigned long)cur->bc_bufs[2], (unsigned long)cur->bc_bufs[3], |
272 | (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], | 273 | (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], |
@@ -1826,7 +1827,7 @@ __xfs_bmbt_get_all( | |||
1826 | 1827 | ||
1827 | void | 1828 | void |
1828 | xfs_bmbt_get_all( | 1829 | xfs_bmbt_get_all( |
1829 | xfs_bmbt_rec_t *r, | 1830 | xfs_bmbt_rec_host_t *r, |
1830 | xfs_bmbt_irec_t *s) | 1831 | xfs_bmbt_irec_t *s) |
1831 | { | 1832 | { |
1832 | __xfs_bmbt_get_all(r->l0, r->l1, s); | 1833 | __xfs_bmbt_get_all(r->l0, r->l1, s); |
@@ -1862,7 +1863,7 @@ xfs_bmbt_get_block( | |||
1862 | */ | 1863 | */ |
1863 | xfs_filblks_t | 1864 | xfs_filblks_t |
1864 | xfs_bmbt_get_blockcount( | 1865 | xfs_bmbt_get_blockcount( |
1865 | xfs_bmbt_rec_t *r) | 1866 | xfs_bmbt_rec_host_t *r) |
1866 | { | 1867 | { |
1867 | return (xfs_filblks_t)(r->l1 & XFS_MASK64LO(21)); | 1868 | return (xfs_filblks_t)(r->l1 & XFS_MASK64LO(21)); |
1868 | } | 1869 | } |
@@ -1872,7 +1873,7 @@ xfs_bmbt_get_blockcount( | |||
1872 | */ | 1873 | */ |
1873 | xfs_fsblock_t | 1874 | xfs_fsblock_t |
1874 | xfs_bmbt_get_startblock( | 1875 | xfs_bmbt_get_startblock( |
1875 | xfs_bmbt_rec_t *r) | 1876 | xfs_bmbt_rec_host_t *r) |
1876 | { | 1877 | { |
1877 | #if XFS_BIG_BLKNOS | 1878 | #if XFS_BIG_BLKNOS |
1878 | return (((xfs_fsblock_t)r->l0 & XFS_MASK64LO(9)) << 43) | | 1879 | return (((xfs_fsblock_t)r->l0 & XFS_MASK64LO(9)) << 43) | |
@@ -1896,7 +1897,7 @@ xfs_bmbt_get_startblock( | |||
1896 | */ | 1897 | */ |
1897 | xfs_fileoff_t | 1898 | xfs_fileoff_t |
1898 | xfs_bmbt_get_startoff( | 1899 | xfs_bmbt_get_startoff( |
1899 | xfs_bmbt_rec_t *r) | 1900 | xfs_bmbt_rec_host_t *r) |
1900 | { | 1901 | { |
1901 | return ((xfs_fileoff_t)r->l0 & | 1902 | return ((xfs_fileoff_t)r->l0 & |
1902 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; | 1903 | XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; |
@@ -1904,7 +1905,7 @@ xfs_bmbt_get_startoff( | |||
1904 | 1905 | ||
1905 | xfs_exntst_t | 1906 | xfs_exntst_t |
1906 | xfs_bmbt_get_state( | 1907 | xfs_bmbt_get_state( |
1907 | xfs_bmbt_rec_t *r) | 1908 | xfs_bmbt_rec_host_t *r) |
1908 | { | 1909 | { |
1909 | int ext_flag; | 1910 | int ext_flag; |
1910 | 1911 | ||
@@ -2294,7 +2295,7 @@ xfs_bmbt_newroot( | |||
2294 | */ | 2295 | */ |
2295 | void | 2296 | void |
2296 | xfs_bmbt_set_all( | 2297 | xfs_bmbt_set_all( |
2297 | xfs_bmbt_rec_t *r, | 2298 | xfs_bmbt_rec_host_t *r, |
2298 | xfs_bmbt_irec_t *s) | 2299 | xfs_bmbt_irec_t *s) |
2299 | { | 2300 | { |
2300 | int extent_flag; | 2301 | int extent_flag; |
@@ -2336,7 +2337,7 @@ xfs_bmbt_set_all( | |||
2336 | */ | 2337 | */ |
2337 | void | 2338 | void |
2338 | xfs_bmbt_set_allf( | 2339 | xfs_bmbt_set_allf( |
2339 | xfs_bmbt_rec_t *r, | 2340 | xfs_bmbt_rec_host_t *r, |
2340 | xfs_fileoff_t o, | 2341 | xfs_fileoff_t o, |
2341 | xfs_fsblock_t b, | 2342 | xfs_fsblock_t b, |
2342 | xfs_filblks_t c, | 2343 | xfs_filblks_t c, |
@@ -2468,7 +2469,7 @@ xfs_bmbt_disk_set_allf( | |||
2468 | */ | 2469 | */ |
2469 | void | 2470 | void |
2470 | xfs_bmbt_set_blockcount( | 2471 | xfs_bmbt_set_blockcount( |
2471 | xfs_bmbt_rec_t *r, | 2472 | xfs_bmbt_rec_host_t *r, |
2472 | xfs_filblks_t v) | 2473 | xfs_filblks_t v) |
2473 | { | 2474 | { |
2474 | ASSERT((v & XFS_MASK64HI(43)) == 0); | 2475 | ASSERT((v & XFS_MASK64HI(43)) == 0); |
@@ -2481,7 +2482,7 @@ xfs_bmbt_set_blockcount( | |||
2481 | */ | 2482 | */ |
2482 | void | 2483 | void |
2483 | xfs_bmbt_set_startblock( | 2484 | xfs_bmbt_set_startblock( |
2484 | xfs_bmbt_rec_t *r, | 2485 | xfs_bmbt_rec_host_t *r, |
2485 | xfs_fsblock_t v) | 2486 | xfs_fsblock_t v) |
2486 | { | 2487 | { |
2487 | #if XFS_BIG_BLKNOS | 2488 | #if XFS_BIG_BLKNOS |
@@ -2509,7 +2510,7 @@ xfs_bmbt_set_startblock( | |||
2509 | */ | 2510 | */ |
2510 | void | 2511 | void |
2511 | xfs_bmbt_set_startoff( | 2512 | xfs_bmbt_set_startoff( |
2512 | xfs_bmbt_rec_t *r, | 2513 | xfs_bmbt_rec_host_t *r, |
2513 | xfs_fileoff_t v) | 2514 | xfs_fileoff_t v) |
2514 | { | 2515 | { |
2515 | ASSERT((v & XFS_MASK64HI(9)) == 0); | 2516 | ASSERT((v & XFS_MASK64HI(9)) == 0); |
@@ -2523,7 +2524,7 @@ xfs_bmbt_set_startoff( | |||
2523 | */ | 2524 | */ |
2524 | void | 2525 | void |
2525 | xfs_bmbt_set_state( | 2526 | xfs_bmbt_set_state( |
2526 | xfs_bmbt_rec_t *r, | 2527 | xfs_bmbt_rec_host_t *r, |
2527 | xfs_exntst_t v) | 2528 | xfs_exntst_t v) |
2528 | { | 2529 | { |
2529 | ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); | 2530 | ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); |
@@ -2624,10 +2625,8 @@ xfs_check_nostate_extents( | |||
2624 | xfs_extnum_t idx, | 2625 | xfs_extnum_t idx, |
2625 | xfs_extnum_t num) | 2626 | xfs_extnum_t num) |
2626 | { | 2627 | { |
2627 | xfs_bmbt_rec_t *ep; | ||
2628 | |||
2629 | for (; num > 0; num--, idx++) { | 2628 | for (; num > 0; num--, idx++) { |
2630 | ep = xfs_iext_get_ext(ifp, idx); | 2629 | xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, idx); |
2631 | if ((ep->l0 >> | 2630 | if ((ep->l0 >> |
2632 | (64 - BMBT_EXNTFLAG_BITLEN)) != 0) { | 2631 | (64 - BMBT_EXNTFLAG_BITLEN)) != 0) { |
2633 | ASSERT(0); | 2632 | ASSERT(0); |