lkml.org 
[lkml]   [2009]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 17/21] ceph: nfs re-export support
Sage Weil wrote:
> I've done the same thing in a bunch of other places, too, the
> big offender being decode.h, where e.g.
>
> v = le64_to_cpu(*(__le64 *)*(p)); \
> *(p) += sizeof(u64); \
>
> should be
>
> v = le64_to_cpu(get_unaligned((__le64 *)*(p))); \
> *(p) += sizeof(u64); \

Endian conversion and unaligned access can be combined, e.g.

v = get_unaligned_le64(*p);

if p is a pointer to a pointer to an unaligned __le64. These too come
via <asm/unaligned.h> and are available since 2.6.26.
--
Stefan Richter
-=====-==--= -==- =-=--
http://arcgraph.de/sr/


\
 
 \ /
  Last update: 2009-06-20 23:25    [W:0.065 / U:1.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site