]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
fix pointer alignment issues on IA64 in handling block map structures.
authorNathan Scott <nathans@sgi.com>
Mon, 15 Oct 2001 10:34:04 +0000 (10:34 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 15 Oct 2001 10:34:04 +0000 (10:34 +0000)
db/bmap.c
include/libxfs.h
libxfs/xfs_bmap_btree.c
repair/dinode.c

index 69e2d3dd9b45de2946a6c81f10e4ca146ba3c545..634e16c07d35763b78229ae1d126e35924c7bdc7 100644 (file)
--- a/db/bmap.c
+++ b/db/bmap.c
@@ -289,15 +289,17 @@ bmap_one_extent(
 
 void
 convert_extent(
-       xfs_bmbt_rec_64_t               *rp,
+       xfs_bmbt_rec_64_t       *rp,
        xfs_dfiloff_t           *op,
        xfs_dfsbno_t            *sp,
        xfs_dfilblks_t          *cp,
        int                     *fp)
 {
        xfs_bmbt_irec_t irec, *s = &irec;
+       xfs_bmbt_rec_t rpcopy, *p = &rpcopy;
 
-       libxfs_bmbt_get_all((xfs_bmbt_rec_t *)rp, s);
+       memmove(&rpcopy, rp, sizeof(rpcopy));
+       libxfs_bmbt_get_all(p, s);
 
        if (s->br_state == XFS_EXT_UNWRITTEN) {
                *fp = 1;
index 93ba22293850d07d9a2e98e0eba3fc59f505a7ce..a01b3b19f95b979d55643580d6caf3758b641216 100644 (file)
@@ -425,7 +425,7 @@ extern int  libxfs_attr_leaf_newentsize (xfs_da_args_t *, int, int *);
 
 extern xfs_filblks_t   libxfs_bmbt_get_blockcount (xfs_bmbt_rec_t *);
 extern xfs_fileoff_t   libxfs_bmbt_get_startoff (xfs_bmbt_rec_t *);
-extern void    libxfs_bmbt_get_all (xfs_bmbt_rec_32_t *, xfs_bmbt_irec_t *);
+extern void    libxfs_bmbt_get_all (xfs_bmbt_rec_t *, xfs_bmbt_irec_t *);
 
 extern int     libxfs_free_extent (xfs_trans_t *, xfs_fsblock_t, xfs_extlen_t);
 extern int     libxfs_rtfree_extent (xfs_trans_t *, xfs_rtblock_t,
index 5948c4af395bf86558f2790938f6abd9f21a7802..4335ef061d6d700c465b70c59d23222ba1a5584f 100644 (file)
@@ -1552,21 +1552,14 @@ xfs_bmbt_delete(
  * Convert a compressed bmap extent record to an uncompressed form.
  * This code must be in sync with the routines xfs_bmbt_get_startoff,
  * xfs_bmbt_get_startblock, xfs_bmbt_get_blockcount and xfs_bmbt_get_state.
- *
- * In the kernel this function is called with xfs_bmbt_rec_t, the caller has
- * already ensured that the data is suitably aligned.  In commands, the data is
- * aligned to 32 bit until it gets here so this routine has to convert to the
- * machine alignment.  This is a divergence between kernel and commands.  KAO.
  */
 void
 xfs_bmbt_get_all(
-       xfs_bmbt_rec_32_t *rp,
+       xfs_bmbt_rec_t *r,
        xfs_bmbt_irec_t *s)
 {
        int     ext_flag;
        xfs_exntst_t st;
-       xfs_bmbt_rec_t rpcopy, *r = &rpcopy;
-       memcpy(&rpcopy, rp, sizeof(rpcopy));
 
 #if BMBT_USE_64
        ext_flag = (int)((INT_GET(r->l0, ARCH_CONVERT)) >> (64 - BMBT_EXNTFLAG_BITLEN));
index 520d579b503af21a4dadcb1d6921a473b49fe4ed..807c335033e23ae8c63cd5b24db368640508e935 100644 (file)
@@ -443,8 +443,11 @@ convert_extent(
        int                     *fp)    /* extent flag */
 {
        xfs_bmbt_irec_t irec, *s = &irec;
+       xfs_bmbt_rec_t rpcopy, *p = &rpcopy;
+
+       memcpy(&rpcopy, rp, sizeof(rpcopy));
        /* Just use the extent parsing routine from the kernel */
-       libxfs_bmbt_get_all(rp, s);
+       libxfs_bmbt_get_all(p, s);
 
        if (fs_has_extflgbit)  {
                if (s->br_state == XFS_EXT_UNWRITTEN) {