Lines Matching refs:desc

34 typedef size_t (*xdr_skb_read_actor)(struct xdr_skb_reader *desc, void *to,
47 xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len) in xdr_skb_read_bits() argument
49 if (len > desc->count) in xdr_skb_read_bits()
50 len = desc->count; in xdr_skb_read_bits()
51 if (unlikely(skb_copy_bits(desc->skb, desc->offset, to, len))) in xdr_skb_read_bits()
53 desc->count -= len; in xdr_skb_read_bits()
54 desc->offset += len; in xdr_skb_read_bits()
66 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
71 if (len > desc->count) in xdr_skb_read_and_csum_bits()
72 len = desc->count; in xdr_skb_read_and_csum_bits()
73 pos = desc->offset; in xdr_skb_read_and_csum_bits()
74 csum2 = skb_copy_and_csum_bits(desc->skb, pos, to, len); in xdr_skb_read_and_csum_bits()
75 desc->csum = csum_block_add(desc->csum, csum2, pos); in xdr_skb_read_and_csum_bits()
76 desc->count -= len; in xdr_skb_read_and_csum_bits()
77 desc->offset += len; in xdr_skb_read_and_csum_bits()
90 xdr_partial_copy_from_skb(struct xdr_buf *xdr, unsigned int base, struct xdr_skb_reader *desc, xdr_… in xdr_partial_copy_from_skb() argument
100 ret = copy_actor(desc, (char *)xdr->head[0].iov_base + base, len); in xdr_partial_copy_from_skb()
102 if (ret != len || !desc->count) in xdr_partial_copy_from_skb()
140 ret = copy_actor(desc, kaddr + base, len); in xdr_partial_copy_from_skb()
145 ret = copy_actor(desc, kaddr, len); in xdr_partial_copy_from_skb()
150 if (ret != len || !desc->count) in xdr_partial_copy_from_skb()
157 copied += copy_actor(desc, (char *)xdr->tail[0].iov_base + base, len - base); in xdr_partial_copy_from_skb()
172 struct xdr_skb_reader desc; in csum_partial_copy_to_xdr() local
174 desc.skb = skb; in csum_partial_copy_to_xdr()
175 desc.offset = 0; in csum_partial_copy_to_xdr()
176 desc.count = skb->len - desc.offset; in csum_partial_copy_to_xdr()
181 desc.csum = csum_partial(skb->data, desc.offset, skb->csum); in csum_partial_copy_to_xdr()
182 if (xdr_partial_copy_from_skb(xdr, 0, &desc, xdr_skb_read_and_csum_bits) < 0) in csum_partial_copy_to_xdr()
184 if (desc.offset != skb->len) { in csum_partial_copy_to_xdr()
186 csum2 = skb_checksum(skb, desc.offset, skb->len - desc.offset, 0); in csum_partial_copy_to_xdr()
187 desc.csum = csum_block_add(desc.csum, csum2, desc.offset); in csum_partial_copy_to_xdr()
189 if (desc.count) in csum_partial_copy_to_xdr()
191 if (csum_fold(desc.csum)) in csum_partial_copy_to_xdr()
198 if (xdr_partial_copy_from_skb(xdr, 0, &desc, xdr_skb_read_bits) < 0) in csum_partial_copy_to_xdr()
200 if (desc.count) in csum_partial_copy_to_xdr()