• Home
  • Raw
  • Download

Lines Matching refs:sg

14 	if (msg->sg.end > msg->sg.start &&  in sk_msg_try_coalesce_ok()
15 elem_first_coalesce < msg->sg.end) in sk_msg_try_coalesce_ok()
18 if (msg->sg.end < msg->sg.start && in sk_msg_try_coalesce_ok()
19 (elem_first_coalesce > msg->sg.start || in sk_msg_try_coalesce_ok()
20 elem_first_coalesce < msg->sg.end)) in sk_msg_try_coalesce_ok()
30 u32 osize = msg->sg.size; in sk_msg_alloc()
33 len -= msg->sg.size; in sk_msg_alloc()
51 i = msg->sg.end; in sk_msg_alloc()
53 sge = &msg->sg.data[i]; in sk_msg_alloc()
65 sge = &msg->sg.data[msg->sg.end]; in sk_msg_alloc()
73 msg->sg.size += use; in sk_msg_alloc()
89 int i = src->sg.start; in sk_msg_clone()
99 if (i == src->sg.end && off) in sk_msg_clone()
109 if (dst->sg.end) in sk_msg_clone()
110 sgd = sk_msg_elem(dst, dst->sg.end - 1); in sk_msg_clone()
116 dst->sg.size += sge_len; in sk_msg_clone()
128 if (i == src->sg.end && len) in sk_msg_clone()
139 int i = msg->sg.start; in sk_msg_return_zero()
156 } while (bytes && i != msg->sg.end); in sk_msg_return_zero()
157 msg->sg.start = i; in sk_msg_return_zero()
163 int i = msg->sg.start; in sk_msg_return()
166 struct scatterlist *sge = &msg->sg.data[i]; in sk_msg_return()
172 } while (i != msg->sg.end); in sk_msg_return()
198 while (msg->sg.size) { in __sk_msg_free()
199 msg->sg.size -= sge->length; in __sk_msg_free()
202 sk_msg_check_to_free(msg, i, msg->sg.size); in __sk_msg_free()
212 return __sk_msg_free(sk, msg, msg->sg.start, false); in sk_msg_free_nocharge()
218 return __sk_msg_free(sk, msg, msg->sg.start, true); in sk_msg_free()
226 u32 i = msg->sg.start; in __sk_msg_free_partial()
237 msg->sg.size -= bytes; in __sk_msg_free_partial()
241 msg->sg.size -= sge->length; in __sk_msg_free_partial()
247 msg->sg.start = i; in __sk_msg_free_partial()
264 int trim = msg->sg.size - len; in sk_msg_trim()
265 u32 i = msg->sg.end; in sk_msg_trim()
273 msg->sg.size = len; in sk_msg_trim()
274 while (msg->sg.data[i].length && in sk_msg_trim()
275 trim >= msg->sg.data[i].length) { in sk_msg_trim()
276 trim -= msg->sg.data[i].length; in sk_msg_trim()
283 msg->sg.data[i].length -= trim; in sk_msg_trim()
286 if (msg->sg.curr == i && msg->sg.copybreak > msg->sg.data[i].length) in sk_msg_trim()
287 msg->sg.copybreak = msg->sg.data[i].length; in sk_msg_trim()
290 msg->sg.end = i; in sk_msg_trim()
298 if (!msg->sg.size) { in sk_msg_trim()
299 msg->sg.curr = msg->sg.start; in sk_msg_trim()
300 msg->sg.copybreak = 0; in sk_msg_trim()
301 } else if (sk_msg_iter_dist(msg->sg.start, msg->sg.curr) >= in sk_msg_trim()
302 sk_msg_iter_dist(msg->sg.start, msg->sg.end)) { in sk_msg_trim()
304 msg->sg.curr = i; in sk_msg_trim()
305 msg->sg.copybreak = msg->sg.data[i].length; in sk_msg_trim()
318 orig = msg->sg.size; in sk_msg_zerocopy_from_iter()
336 msg->sg.size += copied; in sk_msg_zerocopy_from_iter()
340 sg_set_page(&msg->sg.data[msg->sg.end], in sk_msg_zerocopy_from_iter()
342 sg_unmark_end(&msg->sg.data[msg->sg.end]); in sk_msg_zerocopy_from_iter()
355 msg->sg.copybreak = 0; in sk_msg_zerocopy_from_iter()
356 msg->sg.curr = msg->sg.end; in sk_msg_zerocopy_from_iter()
363 iov_iter_revert(from, msg->sg.size - orig); in sk_msg_zerocopy_from_iter()
371 int ret = -ENOSPC, i = msg->sg.curr; in sk_msg_memcopy_from_iter()
379 if (msg->sg.copybreak >= sge->length) { in sk_msg_memcopy_from_iter()
380 msg->sg.copybreak = 0; in sk_msg_memcopy_from_iter()
382 if (i == msg->sg.end) 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()
390 msg->sg.copybreak += copy; in sk_msg_memcopy_from_iter()
402 msg->sg.copybreak = 0; in sk_msg_memcopy_from_iter()
404 } while (i != msg->sg.end); in sk_msg_memcopy_from_iter()
406 msg->sg.curr = i; in sk_msg_memcopy_from_iter()
427 i = msg_rx->sg.start; in sk_msg_recvmsg()
449 msg_rx->sg.size -= copy; in sk_msg_recvmsg()
467 } while ((i != msg_rx->sg.end) && !sg_is_last(sge)); in sk_msg_recvmsg()
476 msg_rx->sg.start = i; in sk_msg_recvmsg()
477 if (!sge->length && (i == msg_rx->sg.end || sg_is_last(sge))) { in sk_msg_recvmsg()
538 num_sge = skb_to_sgvec(skb, msg->sg.data, off, len); in sk_psock_skb_ingress_enqueue()
543 msg->sg.start = 0; in sk_psock_skb_ingress_enqueue()
544 msg->sg.size = copied; in sk_psock_skb_ingress_enqueue()
545 msg->sg.end = num_sge; in sk_psock_skb_ingress_enqueue()