]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Remove IA64 unlaigned accesses in xfs_repair
authorKeith Owens <kaos@sgi.com>
Mon, 15 Oct 2001 07:10:41 +0000 (07:10 +0000)
committerKeith Owens <kaos@sgi.com>
Mon, 15 Oct 2001 07:10:41 +0000 (07:10 +0000)
include/libxfs.h
libxfs/xfs_bmap_btree.c
repair/dinode.c

index a01b3b19f95b979d55643580d6caf3758b641216..93ba22293850d07d9a2e98e0eba3fc59f505a7ce 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_t *, xfs_bmbt_irec_t *);
+extern void    libxfs_bmbt_get_all (xfs_bmbt_rec_32_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 3fed3a7ffb3ef89255d20a0cfd46e7cc092115fa..5948c4af395bf86558f2790938f6abd9f21a7802 100644 (file)
@@ -1552,14 +1552,21 @@ 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_t  *r,
+       xfs_bmbt_rec_32_t *rp,
        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 428f4059558d476de7284e27c98d833ddf226c96..520d579b503af21a4dadcb1d6921a473b49fe4ed 100644 (file)
@@ -444,7 +444,7 @@ convert_extent(
 {
        xfs_bmbt_irec_t irec, *s = &irec;
        /* Just use the extent parsing routine from the kernel */
-       libxfs_bmbt_get_all((xfs_bmbt_rec_t *)rp, s);
+       libxfs_bmbt_get_all(rp, s);
 
        if (fs_has_extflgbit)  {
                if (s->br_state == XFS_EXT_UNWRITTEN) {