skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

Replace sock_zerocopy_put with the generic skb_zcopy_put()
function.  Pass 'true' as the success argument, as this
is identical to no change.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jonathan Lemon
2021-01-06 14:18:32 -08:00
committed by Jakub Kicinski
parent 75518851a2
commit 59776362b1
3 changed files with 8 additions and 10 deletions

View File

@ -496,7 +496,6 @@ static inline void sock_zerocopy_get(struct ubuf_info *uarg)
refcount_inc(&uarg->refcnt); refcount_inc(&uarg->refcnt);
} }
void sock_zerocopy_put(struct ubuf_info *uarg);
void sock_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref); void sock_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref);
void sock_zerocopy_callback(struct ubuf_info *uarg, bool success); void sock_zerocopy_callback(struct ubuf_info *uarg, bool success);
@ -1471,6 +1470,12 @@ 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)
{
if (uarg)
uarg->callback(uarg, true);
}
/* Release a reference on a zerocopy structure */ /* Release a reference on a zerocopy structure */
static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy) static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy)
{ {

View File

@ -1251,13 +1251,6 @@ void sock_zerocopy_callback(struct ubuf_info *uarg, bool success)
} }
EXPORT_SYMBOL_GPL(sock_zerocopy_callback); EXPORT_SYMBOL_GPL(sock_zerocopy_callback);
void sock_zerocopy_put(struct ubuf_info *uarg)
{
if (uarg)
uarg->callback(uarg, uarg->zerocopy);
}
EXPORT_SYMBOL_GPL(sock_zerocopy_put);
void sock_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref) void sock_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref)
{ {
if (uarg) { if (uarg) {
@ -1267,7 +1260,7 @@ void sock_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref)
uarg->len--; uarg->len--;
if (have_uref) if (have_uref)
sock_zerocopy_put(uarg); skb_zcopy_put(uarg);
} }
} }
EXPORT_SYMBOL_GPL(sock_zerocopy_put_abort); EXPORT_SYMBOL_GPL(sock_zerocopy_put_abort);

View File

@ -1429,7 +1429,7 @@ out:
tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
} }
out_nopush: out_nopush:
sock_zerocopy_put(uarg); skb_zcopy_put(uarg);
return copied + copied_syn; return copied + copied_syn;
do_error: do_error: