Skip to content

Commit

Permalink
sunrpc: xdr_xcode_hyper helpers cannot presume 64-bit alignment
Browse files Browse the repository at this point in the history
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Benny Halevy authored and Trond Myklebust committed Sep 23, 2009
1 parent 9423a08 commit 97363c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/sunrpc/xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/uio.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <linux/scatterlist.h>

/*
Expand Down Expand Up @@ -117,14 +118,14 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le
static inline __be32 *
xdr_encode_hyper(__be32 *p, __u64 val)
{
*(__be64 *)p = cpu_to_be64(val);
put_unaligned_be64(val, p);
return p + 2;
}

static inline __be32 *
xdr_decode_hyper(__be32 *p, __u64 *valp)
{
*valp = be64_to_cpup((__be64 *)p);
*valp = get_unaligned_be64(p);
return p + 2;
}

Expand Down

0 comments on commit 97363c6

Please sign in to comment.