]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
skbuff: Rename skb_zcopy_{get|put} to net_zcopy_{get|put}
authorJonathan Lemon <jonathan.lemon@gmail.com>
Wed, 6 Jan 2021 22:18:41 +0000 (14:18 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Jan 2021 00:08:37 +0000 (16:08 -0800)
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: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/skbuff.h
net/core/skbuff.c
net/ipv4/ip_output.c
net/ipv4/tcp.c
net/ipv6/ip6_output.c

index 68ad45a98810e1ffc9cd908c29c4b0242a0f8525..7a057b1f1eb8513dc77f9cd2400c1e0bab533184 100644 (file)
@@ -1443,7 +1443,7 @@ static inline struct ubuf_info *skb_zcopy(struct sk_buff *skb)
        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);
 }
@@ -1461,7 +1461,7 @@ static inline void skb_zcopy_set(struct sk_buff *skb, struct ubuf_info *uarg,
                if (unlikely(have_ref && *have_ref))
                        *have_ref = false;
                else
-                       skb_zcopy_get(uarg);
+                       net_zcopy_get(uarg);
                skb_zcopy_init(skb, uarg);
        }
 }
@@ -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);
 }
 
-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);
        }
 }
 
index a7bcbbff99e3a45c53a89769f9e5419f6bfd5d2d..7626a33cce590e530f36167bd096026916131897 100644 (file)
@@ -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) */
                        if (sk->sk_type == SOCK_STREAM)
-                               skb_zcopy_get(uarg);
+                               net_zcopy_get(uarg);
 
                        return uarg;
                }
index ffee0372928599f274e3fd9a89f2bef3c3b286e3..102b1998ba3c650e84b7756d73fff57cd453fa4c 100644 (file)
@@ -1230,7 +1230,7 @@ alloc_new_skb:
 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);
index 1954190b33c76553ea119ca87e9555e36c17f57e..2267d21c73a6dede5e15fd45c207a9b4adbaeaff 100644 (file)
@@ -1429,7 +1429,7 @@ out:
                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:
@@ -1440,7 +1440,7 @@ do_fault:
        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)) {
index f59cfa39686a59b0b00fb0892527c807019c2da7..072ce967861637fb003fd2b024e9bc2f6d4c8621 100644 (file)
@@ -1715,7 +1715,7 @@ alloc_new_skb:
 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);