aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_btree.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-16 02:23:40 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 02:25:51 -0400
commita6f64d4aea0d0c8483e910c7dd2d1ee48e42245c (patch)
treef3fb20bb6d816f6d674bd4c8bfa687b013443eaf /fs/xfs/xfs_bmap_btree.h
parentd580ef6eaae6eaaef1e06c7d689fc9949faee9da (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.h')
-rw-r--r--fs/xfs/xfs_bmap_btree.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index a77b1b753d0c..268289059022 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -89,6 +89,10 @@ typedef struct xfs_bmbt_rec_64
89typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */ 89typedef __uint64_t xfs_bmbt_rec_base_t; /* use this for casts */
90typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t, xfs_bmdr_rec_t; 90typedef xfs_bmbt_rec_64_t xfs_bmbt_rec_t, xfs_bmdr_rec_t;
91 91
92typedef struct xfs_bmbt_rec_host {
93 __uint64_t l0, l1;
94} xfs_bmbt_rec_host_t;
95
92/* 96/*
93 * Values and macros for delayed-allocation startblock fields. 97 * Values and macros for delayed-allocation startblock fields.
94 */ 98 */
@@ -281,13 +285,13 @@ extern ktrace_t *xfs_bmbt_trace_buf;
281extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int); 285extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int);
282extern int xfs_bmbt_decrement(struct xfs_btree_cur *, int, int *); 286extern int xfs_bmbt_decrement(struct xfs_btree_cur *, int, int *);
283extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *); 287extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *);
284extern void xfs_bmbt_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); 288extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s);
285extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur, 289extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur,
286 int, struct xfs_buf **bpp); 290 int, struct xfs_buf **bpp);
287extern xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_t *r); 291extern xfs_filblks_t xfs_bmbt_get_blockcount(xfs_bmbt_rec_host_t *r);
288extern xfs_fsblock_t xfs_bmbt_get_startblock(xfs_bmbt_rec_t *r); 292extern xfs_fsblock_t xfs_bmbt_get_startblock(xfs_bmbt_rec_host_t *r);
289extern xfs_fileoff_t xfs_bmbt_get_startoff(xfs_bmbt_rec_t *r); 293extern xfs_fileoff_t xfs_bmbt_get_startoff(xfs_bmbt_rec_host_t *r);
290extern xfs_exntst_t xfs_bmbt_get_state(xfs_bmbt_rec_t *r); 294extern xfs_exntst_t xfs_bmbt_get_state(xfs_bmbt_rec_host_t *r);
291 295
292#ifndef XFS_NATIVE_HOST 296#ifndef XFS_NATIVE_HOST
293extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); 297extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
@@ -315,13 +319,13 @@ extern int xfs_bmbt_lookup_ge(struct xfs_btree_cur *, xfs_fileoff_t,
315 */ 319 */
316extern int xfs_bmbt_newroot(struct xfs_btree_cur *cur, int *lflags, int *stat); 320extern int xfs_bmbt_newroot(struct xfs_btree_cur *cur, int *lflags, int *stat);
317 321
318extern void xfs_bmbt_set_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); 322extern void xfs_bmbt_set_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s);
319extern void xfs_bmbt_set_allf(xfs_bmbt_rec_t *r, xfs_fileoff_t o, 323extern void xfs_bmbt_set_allf(xfs_bmbt_rec_host_t *r, xfs_fileoff_t o,
320 xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); 324 xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v);
321extern void xfs_bmbt_set_blockcount(xfs_bmbt_rec_t *r, xfs_filblks_t v); 325extern void xfs_bmbt_set_blockcount(xfs_bmbt_rec_host_t *r, xfs_filblks_t v);
322extern void xfs_bmbt_set_startblock(xfs_bmbt_rec_t *r, xfs_fsblock_t v); 326extern void xfs_bmbt_set_startblock(xfs_bmbt_rec_host_t *r, xfs_fsblock_t v);
323extern void xfs_bmbt_set_startoff(xfs_bmbt_rec_t *r, xfs_fileoff_t v); 327extern void xfs_bmbt_set_startoff(xfs_bmbt_rec_host_t *r, xfs_fileoff_t v);
324extern void xfs_bmbt_set_state(xfs_bmbt_rec_t *r, xfs_exntst_t v); 328extern void xfs_bmbt_set_state(xfs_bmbt_rec_host_t *r, xfs_exntst_t v);
325 329
326#ifndef XFS_NATIVE_HOST 330#ifndef XFS_NATIVE_HOST
327extern void xfs_bmbt_disk_set_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); 331extern void xfs_bmbt_disk_set_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);