Lines Matching full:chunk

13  * pcl_free - Release all memory associated with a parsed chunk list
14 * @pcl: parsed chunk list
20 struct svc_rdma_chunk *chunk; in pcl_free() local
22 chunk = pcl_first_chunk(pcl); in pcl_free()
23 list_del(&chunk->ch_list); in pcl_free()
24 kfree(chunk); in pcl_free()
30 struct svc_rdma_chunk *chunk; in pcl_alloc_chunk() local
32 chunk = kmalloc(struct_size(chunk, ch_segments, segcount), GFP_KERNEL); in pcl_alloc_chunk()
33 if (!chunk) in pcl_alloc_chunk()
36 chunk->ch_position = position; in pcl_alloc_chunk()
37 chunk->ch_length = 0; in pcl_alloc_chunk()
38 chunk->ch_payload_length = 0; in pcl_alloc_chunk()
39 chunk->ch_segcount = 0; in pcl_alloc_chunk()
40 return chunk; in pcl_alloc_chunk()
56 struct svc_rdma_chunk *chunk) in pcl_insert_position() argument
61 if (pos->ch_position > chunk->ch_position) in pcl_insert_position()
64 __list_add(&chunk->ch_list, pos->ch_list.prev, &pos->ch_list); in pcl_insert_position()
69 struct svc_rdma_chunk *chunk, in pcl_set_read_segment() argument
74 segment = &chunk->ch_segments[chunk->ch_segcount]; in pcl_set_read_segment()
79 trace_svcrdma_decode_rseg(&rctxt->rc_cid, chunk, segment); in pcl_set_read_segment()
81 chunk->ch_length += length; in pcl_set_read_segment()
82 chunk->ch_segcount++; in pcl_set_read_segment()
86 * pcl_alloc_call - Construct a parsed chunk list for the Call body
97 * %true: Parsed chunk list was successfully constructed, and
109 struct svc_rdma_chunk *chunk; in pcl_alloc_call() local
120 chunk = pcl_alloc_chunk(segcount, position); in pcl_alloc_call()
121 if (!chunk) in pcl_alloc_call()
123 pcl_insert_position(pcl, chunk); in pcl_alloc_call()
125 chunk = list_first_entry(&pcl->cl_chunks, in pcl_alloc_call()
130 pcl_set_read_segment(rctxt, chunk, handle, length, offset); in pcl_alloc_call()
137 * pcl_alloc_read - Construct a parsed chunk list for normal Read chunks
148 * %true: Parsed chunk list was successfully constructed, and
154 * - Check for chunk range overlaps
163 struct svc_rdma_chunk *chunk; in pcl_alloc_read() local
173 chunk = pcl_lookup_position(pcl, position); in pcl_alloc_read()
174 if (!chunk) { in pcl_alloc_read()
175 chunk = pcl_alloc_chunk(segcount, position); in pcl_alloc_read()
176 if (!chunk) in pcl_alloc_read()
178 pcl_insert_position(pcl, chunk); in pcl_alloc_read()
181 pcl_set_read_segment(rctxt, chunk, handle, length, offset); in pcl_alloc_read()
188 * pcl_alloc_write - Construct a parsed chunk list from a Write list
190 * @pcl: Parsed chunk list to populate
198 * %true: Parsed chunk list was successfully constructed.
205 struct svc_rdma_chunk *chunk; in pcl_alloc_write() local
213 chunk = pcl_alloc_chunk(segcount, 0); in pcl_alloc_write()
214 if (!chunk) in pcl_alloc_write()
216 list_add_tail(&chunk->ch_list, &pcl->cl_chunks); in pcl_alloc_write()
219 segment = &chunk->ch_segments[j]; in pcl_alloc_write()
223 trace_svcrdma_decode_wseg(&rctxt->rc_cid, chunk, j); in pcl_alloc_write()
225 chunk->ch_length += segment->rs_length; in pcl_alloc_write()
226 chunk->ch_segcount++; in pcl_alloc_write()
248 * @pcl: Chunk list to process
270 struct svc_rdma_chunk *chunk, *next; in pcl_process_nonpayloads() local
274 chunk = pcl_first_chunk(pcl); in pcl_process_nonpayloads()
277 if (!chunk || !chunk->ch_payload_length) in pcl_process_nonpayloads()
281 ret = pcl_process_region(xdr, 0, chunk->ch_position, actor, data); in pcl_process_nonpayloads()
286 while ((next = pcl_next_chunk(pcl, chunk))) { in pcl_process_nonpayloads()
290 start = pcl_chunk_end_offset(chunk); in pcl_process_nonpayloads()
296 chunk = next; in pcl_process_nonpayloads()
300 start = pcl_chunk_end_offset(chunk); in pcl_process_nonpayloads()