Lines Matching refs:sge

36 		struct scatterlist *sge;  in sk_msg_alloc()  local
54 sge = &msg->sg.data[i]; in sk_msg_alloc()
57 sg_page(sge) == pfrag->page && in sk_msg_alloc()
58 sge->offset + sge->length == orig_offset) { in sk_msg_alloc()
59 sge->length += use; in sk_msg_alloc()
66 sge = &msg->sg.data[msg->sg.end]; in sk_msg_alloc()
67 sg_unmark_end(sge); in sk_msg_alloc()
68 sg_set_page(sge, pfrag->page, use, orig_offset); in sk_msg_alloc()
91 struct scatterlist *sge = sk_msg_elem(src, i); in sk_msg_clone() local
96 if (sge->length > off) in sk_msg_clone()
98 off -= sge->length; in sk_msg_clone()
102 sge = sk_msg_elem(src, i); in sk_msg_clone()
106 sge_len = sge->length - off; in sk_msg_clone()
114 (sg_page(sge) == sg_page(sgd)) && in sk_msg_clone()
115 (sg_virt(sge) + off == sg_virt(sgd) + sgd->length)) { in sk_msg_clone()
119 sge_off = sge->offset + off; in sk_msg_clone()
120 sk_msg_page_add(dst, sg_page(sge), sge_len, sge_off); in sk_msg_clone()
131 sge = sk_msg_elem(src, i); in sk_msg_clone()
143 struct scatterlist *sge = sk_msg_elem(msg, i); in sk_msg_return_zero() local
145 if (bytes < sge->length) { in sk_msg_return_zero()
146 sge->length -= bytes; in sk_msg_return_zero()
147 sge->offset += bytes; in sk_msg_return_zero()
152 sk_mem_uncharge(sk, sge->length); in sk_msg_return_zero()
153 bytes -= sge->length; in sk_msg_return_zero()
154 sge->length = 0; in sk_msg_return_zero()
155 sge->offset = 0; in sk_msg_return_zero()
167 struct scatterlist *sge = &msg->sg.data[i]; in sk_msg_return() local
168 int uncharge = (bytes < sge->length) ? bytes : sge->length; in sk_msg_return()
180 struct scatterlist *sge = sk_msg_elem(msg, i); in sk_msg_free_elem() local
181 u32 len = sge->length; in sk_msg_free_elem()
187 put_page(sg_page(sge)); in sk_msg_free_elem()
189 memset(sge, 0, sizeof(*sge)); in sk_msg_free_elem()
196 struct scatterlist *sge = sk_msg_elem(msg, i); in __sk_msg_free() local
200 msg->sg.size -= sge->length; in __sk_msg_free()
204 sge = sk_msg_elem(msg, i); in __sk_msg_free()
226 struct scatterlist *sge; in __sk_msg_free_partial() local
230 sge = sk_msg_elem(msg, i); in __sk_msg_free_partial()
231 if (!sge->length) in __sk_msg_free_partial()
233 if (bytes < sge->length) { in __sk_msg_free_partial()
236 sge->length -= bytes; in __sk_msg_free_partial()
237 sge->offset += bytes; in __sk_msg_free_partial()
242 msg->sg.size -= sge->length; in __sk_msg_free_partial()
243 bytes -= sge->length; in __sk_msg_free_partial()
372 struct scatterlist *sge; in sk_msg_memcopy_from_iter() local
377 sge = sk_msg_elem(msg, i); in sk_msg_memcopy_from_iter()
379 if (msg->sg.copybreak >= sge->length) { in sk_msg_memcopy_from_iter()
384 sge = sk_msg_elem(msg, i); in sk_msg_memcopy_from_iter()
387 buf_size = sge->length - msg->sg.copybreak; in sk_msg_memcopy_from_iter()
389 to = sg_virt(sge) + msg->sg.copybreak; in sk_msg_memcopy_from_iter()
422 struct scatterlist *sge; in sk_msg_recvmsg() local
432 sge = sk_msg_elem(msg_rx, i); in sk_msg_recvmsg()
433 copy = sge->length; in sk_msg_recvmsg()
434 page = sg_page(sge); in sk_msg_recvmsg()
437 copy = copy_page_to_iter(page, sge->offset, copy, iter); in sk_msg_recvmsg()
445 sge->offset += copy; in sk_msg_recvmsg()
446 sge->length -= copy; in sk_msg_recvmsg()
451 if (!sge->length) { in sk_msg_recvmsg()
460 if (copy != sge->length) in sk_msg_recvmsg()
467 } while ((i != msg_rx->sg.end) && !sg_is_last(sge)); in sk_msg_recvmsg()
477 if (!sge->length && (i == msg_rx->sg.end || sg_is_last(sge))) { in sk_msg_recvmsg()