diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sunrpc/svc.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 7b27c09b5604..5df1d319f5d5 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -78,28 +78,45 @@ struct svc_serv { | |||
78 | */ | 78 | */ |
79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) | 79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) |
80 | 80 | ||
81 | static inline u32 svc_getu32(struct kvec *iov) | 81 | static inline u32 svc_getnl(struct kvec *iov) |
82 | { | 82 | { |
83 | u32 val, *vp; | 83 | __be32 val, *vp; |
84 | vp = iov->iov_base; | 84 | vp = iov->iov_base; |
85 | val = *vp++; | 85 | val = *vp++; |
86 | iov->iov_base = (void*)vp; | 86 | iov->iov_base = (void*)vp; |
87 | iov->iov_len -= sizeof(u32); | 87 | iov->iov_len -= sizeof(__be32); |
88 | return ntohl(val); | ||
89 | } | ||
90 | |||
91 | static inline void svc_putnl(struct kvec *iov, u32 val) | ||
92 | { | ||
93 | __be32 *vp = iov->iov_base + iov->iov_len; | ||
94 | *vp = htonl(val); | ||
95 | iov->iov_len += sizeof(__be32); | ||
96 | } | ||
97 | |||
98 | static inline __be32 svc_getu32(struct kvec *iov) | ||
99 | { | ||
100 | __be32 val, *vp; | ||
101 | vp = iov->iov_base; | ||
102 | val = *vp++; | ||
103 | iov->iov_base = (void*)vp; | ||
104 | iov->iov_len -= sizeof(__be32); | ||
88 | return val; | 105 | return val; |
89 | } | 106 | } |
90 | 107 | ||
91 | static inline void svc_ungetu32(struct kvec *iov) | 108 | static inline void svc_ungetu32(struct kvec *iov) |
92 | { | 109 | { |
93 | u32 *vp = (u32 *)iov->iov_base; | 110 | __be32 *vp = (__be32 *)iov->iov_base; |
94 | iov->iov_base = (void *)(vp - 1); | 111 | iov->iov_base = (void *)(vp - 1); |
95 | iov->iov_len += sizeof(*vp); | 112 | iov->iov_len += sizeof(*vp); |
96 | } | 113 | } |
97 | 114 | ||
98 | static inline void svc_putu32(struct kvec *iov, u32 val) | 115 | static inline void svc_putu32(struct kvec *iov, __be32 val) |
99 | { | 116 | { |
100 | u32 *vp = iov->iov_base + iov->iov_len; | 117 | __be32 *vp = iov->iov_base + iov->iov_len; |
101 | *vp = val; | 118 | *vp = val; |
102 | iov->iov_len += sizeof(u32); | 119 | iov->iov_len += sizeof(__be32); |
103 | } | 120 | } |
104 | 121 | ||
105 | 122 | ||