aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/xdr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sunrpc/xdr.h')
-rw-r--r--include/linux/sunrpc/xdr.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index b99c625fddfe..f5cc0898bc53 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <asm/unaligned.h>
14#include <linux/scatterlist.h> 15#include <linux/scatterlist.h>
15 16
16/* 17/*
@@ -117,17 +118,15 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le
117static inline __be32 * 118static inline __be32 *
118xdr_encode_hyper(__be32 *p, __u64 val) 119xdr_encode_hyper(__be32 *p, __u64 val)
119{ 120{
120 *p++ = htonl(val >> 32); 121 put_unaligned_be64(val, p);
121 *p++ = htonl(val & 0xFFFFFFFF); 122 return p + 2;
122 return p;
123} 123}
124 124
125static inline __be32 * 125static inline __be32 *
126xdr_decode_hyper(__be32 *p, __u64 *valp) 126xdr_decode_hyper(__be32 *p, __u64 *valp)
127{ 127{
128 *valp = ((__u64) ntohl(*p++)) << 32; 128 *valp = get_unaligned_be64(p);
129 *valp |= ntohl(*p++); 129 return p + 2;
130 return p;
131} 130}
132 131
133/* 132/*