public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Barry Naujok <bnaujok@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	"xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: [REVIEW] Fix unaligned accesses in IA64 in xfsprogs
Date: Tue, 2 Dec 2008 01:46:35 -0500	[thread overview]
Message-ID: <20081202064634.GA10115@infradead.org> (raw)
In-Reply-To: <op.ulieotl73jf8g2@pc-bnaujok.melbourne.sgi.com>

This patch looks good to go to me.

On Tue, Dec 02, 2008 at 11:37:31AM +1100, Barry Naujok wrote:
> Obviously modifying xfs_bmbt_disk_get_all yields a much smaller patch:
> 
> ===========================================================================
> xfsprogs/db/bmap.c
> ===========================================================================
> 
> --- a/xfsprogs/db/bmap.c	2008-12-02 11:21:00.000000000 +1100
> +++ b/xfsprogs/db/bmap.c	2008-12-02 11:20:41.324928232 +1100
> @@ -277,21 +277,14 @@ convert_extent(
>   	xfs_dfilblks_t		*cp,
>   	int			*fp)
>   {
> -	xfs_bmbt_irec_t irec, *s = &irec;
> -	xfs_bmbt_rec_t rpcopy, *p = &rpcopy;
> +	xfs_bmbt_irec_t		irec;
> 
> -	memmove(&rpcopy, rp, sizeof(rpcopy));
> -	libxfs_bmbt_disk_get_all(p, s);
> +	libxfs_bmbt_disk_get_all(rp, &irec);
> 
> -	if (s->br_state == XFS_EXT_UNWRITTEN) {
> -		*fp = 1;
> -	} else {
> -		*fp = 0;
> -	}
> -
> -	*op = s->br_startoff;
> -	*sp = s->br_startblock;
> -	*cp = s->br_blockcount;
> +	*fp = irec.br_state == XFS_EXT_UNWRITTEN;
> +	*op = irec.br_startoff;
> +	*sp = irec.br_startblock;
> +	*cp = irec.br_blockcount;
>   }
> 
>   void
> 
> ===========================================================================
> xfsprogs/libxfs/xfs_bmap_btree.c
> ===========================================================================
> 
> --- a/xfsprogs/libxfs/xfs_bmap_btree.c	2008-12-02 11:21:00.000000000 +1100
> +++ b/xfsprogs/libxfs/xfs_bmap_btree.c	2008-12-02 11:20:09.553355392 +1100
> @@ -181,7 +181,8 @@ xfs_bmbt_disk_get_all(
>   	xfs_bmbt_rec_t	*r,
>   	xfs_bmbt_irec_t *s)
>   {
> -	__xfs_bmbt_get_all(be64_to_cpu(r->l0), be64_to_cpu(r->l1), s);
> +	__xfs_bmbt_get_all(get_unaligned_be64(&r->l0),
> +				get_unaligned_be64(&r->l1), s);
>   }
> 
>   /*
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2008-12-02  6:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-01  6:34 [REVIEW] Fix unaligned accesses in IA64 in xfsprogs Barry Naujok
2008-12-01 13:42 ` Christoph Hellwig
2008-12-01 23:31   ` Barry Naujok
2008-12-02  0:37   ` Barry Naujok
2008-12-02  6:46     ` Christoph Hellwig [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081202064634.GA10115@infradead.org \
    --to=hch@infradead.org \
    --cc=bnaujok@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox