Messages in this thread | | | Date | Sat, 20 Jun 2009 23:22:09 +0200 | From | Stefan Richter <> | Subject | Re: [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/
| |