diff options
Diffstat (limited to 'include/linux/sunrpc/xdr.h')
-rw-r--r-- | include/linux/sunrpc/xdr.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index ac69e5511606..9e340fa23c06 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 <linux/scatterlist.h> | ||
14 | 15 | ||
15 | /* | 16 | /* |
16 | * Buffer adjustment | 17 | * Buffer adjustment |
@@ -139,29 +140,30 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) | |||
139 | */ | 140 | */ |
140 | extern void xdr_shift_buf(struct xdr_buf *, size_t); | 141 | extern void xdr_shift_buf(struct xdr_buf *, size_t); |
141 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); | 142 | extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); |
142 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); | 143 | extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int); |
143 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); | 144 | extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int); |
144 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, int, void *, int); | 145 | extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
145 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, int, void *, int); | 146 | extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int); |
146 | 147 | ||
147 | /* | 148 | /* |
148 | * Helper structure for copying from an sk_buff. | 149 | * Helper structure for copying from an sk_buff. |
149 | */ | 150 | */ |
150 | typedef struct { | 151 | struct xdr_skb_reader { |
151 | struct sk_buff *skb; | 152 | struct sk_buff *skb; |
152 | unsigned int offset; | 153 | unsigned int offset; |
153 | size_t count; | 154 | size_t count; |
154 | unsigned int csum; | 155 | __wsum csum; |
155 | } skb_reader_t; | 156 | }; |
156 | 157 | ||
157 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); | 158 | typedef size_t (*xdr_skb_read_actor)(struct xdr_skb_reader *desc, void *to, size_t len); |
158 | 159 | ||
160 | size_t xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len); | ||
159 | extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *); | 161 | extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *); |
160 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, | 162 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, |
161 | skb_reader_t *, skb_read_actor_t); | 163 | struct xdr_skb_reader *, xdr_skb_read_actor); |
162 | 164 | ||
163 | extern int xdr_encode_word(struct xdr_buf *, int, u32); | 165 | extern int xdr_encode_word(struct xdr_buf *, unsigned int, u32); |
164 | extern int xdr_decode_word(struct xdr_buf *, int, u32 *); | 166 | extern int xdr_decode_word(struct xdr_buf *, unsigned int, u32 *); |
165 | 167 | ||
166 | struct xdr_array2_desc; | 168 | struct xdr_array2_desc; |
167 | typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem); | 169 | typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem); |
@@ -196,6 +198,7 @@ extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 | |||
196 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 198 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
197 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 199 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
198 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 200 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
201 | extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data); | ||
199 | 202 | ||
200 | #endif /* __KERNEL__ */ | 203 | #endif /* __KERNEL__ */ |
201 | 204 | ||