diff options
Diffstat (limited to 'include/linux/sunrpc/xdr.h')
-rw-r--r-- | include/linux/sunrpc/xdr.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index b99c625fddf..f5cc0898bc5 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -11,6 +11,7 @@ #include <linux/uio.h> #include <asm/byteorder.h> +#include <asm/unaligned.h> #include <linux/scatterlist.h> /* @@ -117,17 +118,15 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le static inline __be32 * xdr_encode_hyper(__be32 *p, __u64 val) { - *p++ = htonl(val >> 32); - *p++ = htonl(val & 0xFFFFFFFF); - return p; + put_unaligned_be64(val, p); + return p + 2; } static inline __be32 * xdr_decode_hyper(__be32 *p, __u64 *valp) { - *valp = ((__u64) ntohl(*p++)) << 32; - *valp |= ntohl(*p++); - return p; + *valp = get_unaligned_be64(p); + return p + 2; } /* |