aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/xdr.h10
-rw-r--r--net/sunrpc/socklib.c8
-rw-r--r--net/sunrpc/xprtsock.c12
3 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index a06aab278fe0..9e340fa23c06 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -148,19 +148,19 @@ extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsign
148/* 148/*
149 * Helper structure for copying from an sk_buff. 149 * Helper structure for copying from an sk_buff.
150 */ 150 */
151typedef struct { 151struct xdr_skb_reader {
152 struct sk_buff *skb; 152 struct sk_buff *skb;
153 unsigned int offset; 153 unsigned int offset;
154 size_t count; 154 size_t count;
155 __wsum csum; 155 __wsum csum;
156} skb_reader_t; 156};
157 157
158typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 158typedef size_t (*xdr_skb_read_actor)(struct xdr_skb_reader *desc, void *to, size_t len);
159 159
160size_t xdr_skb_read_bits(skb_reader_t *desc, void *to, size_t len); 160size_t xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len);
161extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *); 161extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *);
162extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, 162extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
163 skb_reader_t *, skb_read_actor_t); 163 struct xdr_skb_reader *, xdr_skb_read_actor);
164 164
165extern int xdr_encode_word(struct xdr_buf *, unsigned int, u32); 165extern int xdr_encode_word(struct xdr_buf *, unsigned int, u32);
166extern int xdr_decode_word(struct xdr_buf *, unsigned int, u32 *); 166extern int xdr_decode_word(struct xdr_buf *, unsigned int, u32 *);
diff --git a/net/sunrpc/socklib.c b/net/sunrpc/socklib.c
index 9c40d67c1ffb..634885b0c04d 100644
--- a/net/sunrpc/socklib.c
+++ b/net/sunrpc/socklib.c
@@ -24,7 +24,7 @@
24 * Possibly called several times to iterate over an sk_buff and copy 24 * Possibly called several times to iterate over an sk_buff and copy
25 * data out of it. 25 * data out of it.
26 */ 26 */
27size_t xdr_skb_read_bits(skb_reader_t *desc, void *to, size_t len) 27size_t xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len)
28{ 28{
29 if (len > desc->count) 29 if (len > desc->count)
30 len = desc->count; 30 len = desc->count;
@@ -43,7 +43,7 @@ size_t xdr_skb_read_bits(skb_reader_t *desc, void *to, size_t len)
43 * 43 *
44 * Same as skb_read_bits, but calculate a checksum at the same time. 44 * Same as skb_read_bits, but calculate a checksum at the same time.
45 */ 45 */
46static size_t xdr_skb_read_and_csum_bits(skb_reader_t *desc, void *to, size_t len) 46static size_t xdr_skb_read_and_csum_bits(struct xdr_skb_reader *desc, void *to, size_t len)
47{ 47{
48 unsigned int pos; 48 unsigned int pos;
49 __wsum csum2; 49 __wsum csum2;
@@ -66,7 +66,7 @@ static size_t xdr_skb_read_and_csum_bits(skb_reader_t *desc, void *to, size_t le
66 * @copy_actor: virtual method for copying data 66 * @copy_actor: virtual method for copying data
67 * 67 *
68 */ 68 */
69ssize_t xdr_partial_copy_from_skb(struct xdr_buf *xdr, unsigned int base, skb_reader_t *desc, skb_read_actor_t copy_actor) 69ssize_t xdr_partial_copy_from_skb(struct xdr_buf *xdr, unsigned int base, struct xdr_skb_reader *desc, xdr_skb_read_actor copy_actor)
70{ 70{
71 struct page **ppage = xdr->pages; 71 struct page **ppage = xdr->pages;
72 unsigned int len, pglen = xdr->page_len; 72 unsigned int len, pglen = xdr->page_len;
@@ -148,7 +148,7 @@ out:
148 */ 148 */
149int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb) 149int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb)
150{ 150{
151 skb_reader_t desc; 151 struct xdr_skb_reader desc;
152 152
153 desc.skb = skb; 153 desc.skb = skb;
154 desc.offset = sizeof(struct udphdr); 154 desc.offset = sizeof(struct udphdr);
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 450c350a0c62..ad61b3e9123b 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -651,7 +651,7 @@ static void xs_udp_data_ready(struct sock *sk, int len)
651 read_unlock(&sk->sk_callback_lock); 651 read_unlock(&sk->sk_callback_lock);
652} 652}
653 653
654static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, skb_reader_t *desc) 654static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_reader *desc)
655{ 655{
656 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 656 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
657 size_t len, used; 657 size_t len, used;
@@ -697,7 +697,7 @@ static void xs_tcp_check_fraghdr(struct sock_xprt *transport)
697 } 697 }
698} 698}
699 699
700static inline void xs_tcp_read_xid(struct sock_xprt *transport, skb_reader_t *desc) 700static inline void xs_tcp_read_xid(struct sock_xprt *transport, struct xdr_skb_reader *desc)
701{ 701{
702 size_t len, used; 702 size_t len, used;
703 char *p; 703 char *p;
@@ -717,7 +717,7 @@ static inline void xs_tcp_read_xid(struct sock_xprt *transport, skb_reader_t *de
717 xs_tcp_check_fraghdr(transport); 717 xs_tcp_check_fraghdr(transport);
718} 718}
719 719
720static inline void xs_tcp_read_request(struct rpc_xprt *xprt, skb_reader_t *desc) 720static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_reader *desc)
721{ 721{
722 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 722 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
723 struct rpc_rqst *req; 723 struct rpc_rqst *req;
@@ -739,7 +739,7 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, skb_reader_t *desc
739 rcvbuf = &req->rq_private_buf; 739 rcvbuf = &req->rq_private_buf;
740 len = desc->count; 740 len = desc->count;
741 if (len > transport->tcp_reclen - transport->tcp_offset) { 741 if (len > transport->tcp_reclen - transport->tcp_offset) {
742 skb_reader_t my_desc; 742 struct xdr_skb_reader my_desc;
743 743
744 len = transport->tcp_reclen - transport->tcp_offset; 744 len = transport->tcp_reclen - transport->tcp_offset;
745 memcpy(&my_desc, desc, sizeof(my_desc)); 745 memcpy(&my_desc, desc, sizeof(my_desc));
@@ -795,7 +795,7 @@ out:
795 xs_tcp_check_fraghdr(transport); 795 xs_tcp_check_fraghdr(transport);
796} 796}
797 797
798static inline void xs_tcp_read_discard(struct sock_xprt *transport, skb_reader_t *desc) 798static inline void xs_tcp_read_discard(struct sock_xprt *transport, struct xdr_skb_reader *desc)
799{ 799{
800 size_t len; 800 size_t len;
801 801
@@ -813,7 +813,7 @@ static int xs_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, uns
813{ 813{
814 struct rpc_xprt *xprt = rd_desc->arg.data; 814 struct rpc_xprt *xprt = rd_desc->arg.data;
815 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 815 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
816 skb_reader_t desc = { 816 struct xdr_skb_reader desc = {
817 .skb = skb, 817 .skb = skb,
818 .offset = offset, 818 .offset = offset,
819 .count = len, 819 .count = len,