Lines Matching refs:desc
29 size_t xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len) in xdr_skb_read_bits() argument
31 if (len > desc->count) in xdr_skb_read_bits()
32 len = desc->count; in xdr_skb_read_bits()
33 if (unlikely(skb_copy_bits(desc->skb, desc->offset, to, len))) in xdr_skb_read_bits()
35 desc->count -= len; in xdr_skb_read_bits()
36 desc->offset += len; in xdr_skb_read_bits()
49 static size_t xdr_skb_read_and_csum_bits(struct xdr_skb_reader *desc, void *to, size_t len) in xdr_skb_read_and_csum_bits() argument
54 if (len > desc->count) in xdr_skb_read_and_csum_bits()
55 len = desc->count; in xdr_skb_read_and_csum_bits()
56 pos = desc->offset; in xdr_skb_read_and_csum_bits()
57 csum2 = skb_copy_and_csum_bits(desc->skb, pos, to, len, 0); in xdr_skb_read_and_csum_bits()
58 desc->csum = csum_block_add(desc->csum, csum2, pos); in xdr_skb_read_and_csum_bits()
59 desc->count -= len; in xdr_skb_read_and_csum_bits()
60 desc->offset += len; in xdr_skb_read_and_csum_bits()
72 …y_from_skb(struct xdr_buf *xdr, unsigned int base, struct xdr_skb_reader *desc, xdr_skb_read_actor… in xdr_partial_copy_from_skb() argument
82 ret = copy_actor(desc, (char *)xdr->head[0].iov_base + base, len); in xdr_partial_copy_from_skb()
84 if (ret != len || !desc->count) in xdr_partial_copy_from_skb()
122 ret = copy_actor(desc, kaddr + base, len); in xdr_partial_copy_from_skb()
127 ret = copy_actor(desc, kaddr, len); in xdr_partial_copy_from_skb()
132 if (ret != len || !desc->count) in xdr_partial_copy_from_skb()
139 copied += copy_actor(desc, (char *)xdr->tail[0].iov_base + base, len - base); in xdr_partial_copy_from_skb()
155 struct xdr_skb_reader desc; in csum_partial_copy_to_xdr() local
157 desc.skb = skb; in csum_partial_copy_to_xdr()
158 desc.offset = 0; in csum_partial_copy_to_xdr()
159 desc.count = skb->len - desc.offset; in csum_partial_copy_to_xdr()
164 desc.csum = csum_partial(skb->data, desc.offset, skb->csum); in csum_partial_copy_to_xdr()
165 if (xdr_partial_copy_from_skb(xdr, 0, &desc, xdr_skb_read_and_csum_bits) < 0) in csum_partial_copy_to_xdr()
167 if (desc.offset != skb->len) { in csum_partial_copy_to_xdr()
169 csum2 = skb_checksum(skb, desc.offset, skb->len - desc.offset, 0); in csum_partial_copy_to_xdr()
170 desc.csum = csum_block_add(desc.csum, csum2, desc.offset); in csum_partial_copy_to_xdr()
172 if (desc.count) in csum_partial_copy_to_xdr()
174 if (csum_fold(desc.csum)) in csum_partial_copy_to_xdr()
181 if (xdr_partial_copy_from_skb(xdr, 0, &desc, xdr_skb_read_bits) < 0) in csum_partial_copy_to_xdr()
183 if (desc.count) in csum_partial_copy_to_xdr()