xfs
[Top] [All Lists]

Re: [PATCH] xfsprogs: fix unaligned access in libxfs

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH] xfsprogs: fix unaligned access in libxfs
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 28 Aug 2009 18:15:30 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, Gabriel Vlasiu <gabrielvlasiu@xxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABEF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20090828153718.GA26409@xxxxxxxxxxxxx> <1AB9A794DBDDF54A8A81BE2296F7BDFE83ABEF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Fri, Aug 28, 2009 at 04:39:49PM -0500, Alex Elder wrote:
> > +static inline __uint32_t __get_unaligned_be32(const __uint8_t *p)
> 
> 
> It would be nice for this interface (and others) to take a (void *)
> argument, but that would also mean immediately casting it to do
> pointer arithmetic portably.  Not a big deal.

the __ routines are internal implementation details, the kernel
has non-__ prefixed versions that take void pointers, but I didn't
bother to add them to xfsprogs as we only do unaligned access to
64bit values.

That beeing said I dislike the interface taking void pointers as
it removes important error checking.  The actually visible interface
should take __be16/32/64 types to enforce they are used on the right
type.  Once I get some time I will push for that in the kernel again,
but for xfsprogs I really do want to stick to the kernel interfaces so
that we can share the code unmodified.

<Prev in Thread] Current Thread [Next in Thread>