return is_zcopy ? skb_uarg(skb) : NULL;
}
-static inline void skb_zcopy_get(struct ubuf_info *uarg)
+static inline void net_zcopy_get(struct ubuf_info *uarg)
{
refcount_inc(&uarg->refcnt);
}
if (unlikely(have_ref && *have_ref))
*have_ref = false;
else
- skb_zcopy_get(uarg);
+ net_zcopy_get(uarg);
skb_zcopy_init(skb, uarg);
}
}
return (void *)((uintptr_t) skb_shinfo(skb)->destructor_arg & ~0x1UL);
}
-static inline void skb_zcopy_put(struct ubuf_info *uarg)
+static inline void net_zcopy_put(struct ubuf_info *uarg)
{
if (uarg)
uarg->callback(NULL, uarg, true);
}
-static inline void skb_zcopy_put_abort(struct ubuf_info *uarg, bool have_uref)
+static inline void net_zcopy_put_abort(struct ubuf_info *uarg, bool have_uref)
{
if (uarg) {
if (uarg->callback == msg_zerocopy_callback)
msg_zerocopy_put_abort(uarg, have_uref);
else if (have_uref)
- skb_zcopy_put(uarg);
+ net_zcopy_put(uarg);
}
}
/* no extra ref when appending to datagram (MSG_MORE) */
if (sk->sk_type == SOCK_STREAM)
- skb_zcopy_get(uarg);
+ net_zcopy_get(uarg);
return uarg;
}
error_efault:
err = -EFAULT;
error:
- skb_zcopy_put_abort(uarg, extra_uref);
+ net_zcopy_put_abort(uarg, extra_uref);
cork->length -= length;
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
}
out_nopush:
- skb_zcopy_put(uarg);
+ net_zcopy_put(uarg);
return copied + copied_syn;
do_error:
if (copied + copied_syn)
goto out;
out_err:
- skb_zcopy_put_abort(uarg, true);
+ net_zcopy_put_abort(uarg, true);
err = sk_stream_error(sk, flags, err);
/* make sure we wake any epoll edge trigger waiter */
if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) {
error_efault:
err = -EFAULT;
error:
- skb_zcopy_put_abort(uarg, extra_uref);
+ net_zcopy_put_abort(uarg, extra_uref);
cork->length -= length;
IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);
refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);