diff options
Diffstat (limited to 'net/sunrpc/socklib.c')
-rw-r--r-- | net/sunrpc/socklib.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sunrpc/socklib.c b/net/sunrpc/socklib.c index 2635c543ba06..9c40d67c1ffb 100644 --- a/net/sunrpc/socklib.c +++ b/net/sunrpc/socklib.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | 17 | ||
18 | /** | 18 | /** |
19 | * skb_read_bits - copy some data bits from skb to internal buffer | 19 | * xdr_skb_read_bits - copy some data bits from skb to internal buffer |
20 | * @desc: sk_buff copy helper | 20 | * @desc: sk_buff copy helper |
21 | * @to: copy destination | 21 | * @to: copy destination |
22 | * @len: number of bytes to copy | 22 | * @len: number of bytes to copy |
@@ -24,11 +24,11 @@ | |||
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 | */ |
27 | static size_t skb_read_bits(skb_reader_t *desc, void *to, size_t len) | 27 | size_t xdr_skb_read_bits(skb_reader_t *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; |
31 | if (skb_copy_bits(desc->skb, desc->offset, to, len)) | 31 | if (unlikely(skb_copy_bits(desc->skb, desc->offset, to, len))) |
32 | return 0; | 32 | return 0; |
33 | desc->count -= len; | 33 | desc->count -= len; |
34 | desc->offset += len; | 34 | desc->offset += len; |
@@ -36,14 +36,14 @@ static size_t skb_read_bits(skb_reader_t *desc, void *to, size_t len) | |||
36 | } | 36 | } |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * skb_read_and_csum_bits - copy and checksum from skb to buffer | 39 | * xdr_skb_read_and_csum_bits - copy and checksum from skb to buffer |
40 | * @desc: sk_buff copy helper | 40 | * @desc: sk_buff copy helper |
41 | * @to: copy destination | 41 | * @to: copy destination |
42 | * @len: number of bytes to copy | 42 | * @len: number of bytes to copy |
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 | */ |
46 | static size_t skb_read_and_csum_bits(skb_reader_t *desc, void *to, size_t len) | 46 | static size_t xdr_skb_read_and_csum_bits(skb_reader_t *desc, void *to, size_t len) |
47 | { | 47 | { |
48 | unsigned int pos; | 48 | unsigned int pos; |
49 | __wsum csum2; | 49 | __wsum csum2; |
@@ -158,7 +158,7 @@ int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb) | |||
158 | goto no_checksum; | 158 | goto no_checksum; |
159 | 159 | ||
160 | desc.csum = csum_partial(skb->data, desc.offset, skb->csum); | 160 | desc.csum = csum_partial(skb->data, desc.offset, skb->csum); |
161 | if (xdr_partial_copy_from_skb(xdr, 0, &desc, skb_read_and_csum_bits) < 0) | 161 | if (xdr_partial_copy_from_skb(xdr, 0, &desc, xdr_skb_read_and_csum_bits) < 0) |
162 | return -1; | 162 | return -1; |
163 | if (desc.offset != skb->len) { | 163 | if (desc.offset != skb->len) { |
164 | __wsum csum2; | 164 | __wsum csum2; |
@@ -173,7 +173,7 @@ int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb) | |||
173 | netdev_rx_csum_fault(skb->dev); | 173 | netdev_rx_csum_fault(skb->dev); |
174 | return 0; | 174 | return 0; |
175 | no_checksum: | 175 | no_checksum: |
176 | if (xdr_partial_copy_from_skb(xdr, 0, &desc, skb_read_bits) < 0) | 176 | if (xdr_partial_copy_from_skb(xdr, 0, &desc, xdr_skb_read_bits) < 0) |
177 | return -1; | 177 | return -1; |
178 | if (desc.count) | 178 | if (desc.count) |
179 | return -1; | 179 | return -1; |