Commit 8e044917 authored by Jonathan Lemon's avatar Jonathan Lemon Committed by Jakub Kicinski

skbuff: Rename skb_zcopy_{get|put} to net_zcopy_{get|put}

Unlike the rest of the skb_zcopy_ functions, these routines
operate on a 'struct ubuf', not a skb.  Remove the 'skb_'
prefix from the naming to make things clearer.
Suggested-by: default avatarWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: default avatarJonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9ee5e5ad
...@@ -1443,7 +1443,7 @@ static inline struct ubuf_info *skb_zcopy(struct sk_buff *skb) ...@@ -1443,7 +1443,7 @@ static inline struct ubuf_info *skb_zcopy(struct sk_buff *skb)
return is_zcopy ? skb_uarg(skb) : NULL; 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); refcount_inc(&uarg->refcnt);
} }
...@@ -1461,7 +1461,7 @@ static inline void skb_zcopy_set(struct sk_buff *skb, struct ubuf_info *uarg, ...@@ -1461,7 +1461,7 @@ static inline void skb_zcopy_set(struct sk_buff *skb, struct ubuf_info *uarg,
if (unlikely(have_ref && *have_ref)) if (unlikely(have_ref && *have_ref))
*have_ref = false; *have_ref = false;
else else
skb_zcopy_get(uarg); net_zcopy_get(uarg);
skb_zcopy_init(skb, uarg); skb_zcopy_init(skb, uarg);
} }
} }
...@@ -1482,19 +1482,19 @@ static inline void *skb_zcopy_get_nouarg(struct sk_buff *skb) ...@@ -1482,19 +1482,19 @@ static inline void *skb_zcopy_get_nouarg(struct sk_buff *skb)
return (void *)((uintptr_t) skb_shinfo(skb)->destructor_arg & ~0x1UL); 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) if (uarg)
uarg->callback(NULL, uarg, true); 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) {
if (uarg->callback == msg_zerocopy_callback) if (uarg->callback == msg_zerocopy_callback)
msg_zerocopy_put_abort(uarg, have_uref); msg_zerocopy_put_abort(uarg, have_uref);
else if (have_uref) else if (have_uref)
skb_zcopy_put(uarg); net_zcopy_put(uarg);
} }
} }
......
...@@ -1165,7 +1165,7 @@ struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size, ...@@ -1165,7 +1165,7 @@ struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size,
/* no extra ref when appending to datagram (MSG_MORE) */ /* no extra ref when appending to datagram (MSG_MORE) */
if (sk->sk_type == SOCK_STREAM) if (sk->sk_type == SOCK_STREAM)
skb_zcopy_get(uarg); net_zcopy_get(uarg);
return uarg; return uarg;
} }
......
...@@ -1230,7 +1230,7 @@ static int __ip_append_data(struct sock *sk, ...@@ -1230,7 +1230,7 @@ static int __ip_append_data(struct sock *sk,
error_efault: error_efault:
err = -EFAULT; err = -EFAULT;
error: error:
skb_zcopy_put_abort(uarg, extra_uref); net_zcopy_put_abort(uarg, extra_uref);
cork->length -= length; cork->length -= length;
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS); IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
......
...@@ -1429,7 +1429,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1429,7 +1429,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
} }
out_nopush: out_nopush:
skb_zcopy_put(uarg); net_zcopy_put(uarg);
return copied + copied_syn; return copied + copied_syn;
do_error: do_error:
...@@ -1440,7 +1440,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -1440,7 +1440,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
if (copied + copied_syn) if (copied + copied_syn)
goto out; goto out;
out_err: out_err:
skb_zcopy_put_abort(uarg, true); net_zcopy_put_abort(uarg, true);
err = sk_stream_error(sk, flags, err); err = sk_stream_error(sk, flags, err);
/* make sure we wake any epoll edge trigger waiter */ /* make sure we wake any epoll edge trigger waiter */
if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) { if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) {
......
...@@ -1715,7 +1715,7 @@ static int __ip6_append_data(struct sock *sk, ...@@ -1715,7 +1715,7 @@ static int __ip6_append_data(struct sock *sk,
error_efault: error_efault:
err = -EFAULT; err = -EFAULT;
error: error:
skb_zcopy_put_abort(uarg, extra_uref); net_zcopy_put_abort(uarg, extra_uref);
cork->length -= length; cork->length -= length;
IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS); IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);
refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc); refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment