Message ID | 20201222000926.1054993-4-jonathan.lemon@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | Generic zcopy_* functions | expand |
On 12/21/20 5:09 PM, Jonathan Lemon wrote: > diff --git a/net/core/skbuff.c b/net/core/skbuff.c > index 327ee8938f78..ea32b3414ad6 100644 > --- a/net/core/skbuff.c > +++ b/net/core/skbuff.c > @@ -1245,12 +1245,8 @@ EXPORT_SYMBOL_GPL(sock_zerocopy_callback); > > void sock_zerocopy_put(struct ubuf_info *uarg) > { > - if (uarg && refcount_dec_and_test(&uarg->refcnt)) { > - if (uarg->callback) > - uarg->callback(uarg, uarg->zerocopy); > - else > - consume_skb(skb_from_uarg(uarg)); > - } > + if (uarg && refcount_dec_and_test(&uarg->refcnt)) > + uarg->callback(uarg, uarg->zerocopy); > } > EXPORT_SYMBOL_GPL(sock_zerocopy_put); > > since it is down to 2 lines, move to skbuff.h as an inline?
On 12/22/20 9:52 AM, David Ahern wrote: > On 12/21/20 5:09 PM, Jonathan Lemon wrote: >> diff --git a/net/core/skbuff.c b/net/core/skbuff.c >> index 327ee8938f78..ea32b3414ad6 100644 >> --- a/net/core/skbuff.c >> +++ b/net/core/skbuff.c >> @@ -1245,12 +1245,8 @@ EXPORT_SYMBOL_GPL(sock_zerocopy_callback); >> >> void sock_zerocopy_put(struct ubuf_info *uarg) >> { >> - if (uarg && refcount_dec_and_test(&uarg->refcnt)) { >> - if (uarg->callback) >> - uarg->callback(uarg, uarg->zerocopy); >> - else >> - consume_skb(skb_from_uarg(uarg)); >> - } >> + if (uarg && refcount_dec_and_test(&uarg->refcnt)) >> + uarg->callback(uarg, uarg->zerocopy); >> } >> EXPORT_SYMBOL_GPL(sock_zerocopy_put); >> >> > > since it is down to 2 lines, move to skbuff.h as an inline? > nm. that is done in patch 5.
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 327ee8938f78..ea32b3414ad6 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1245,12 +1245,8 @@ EXPORT_SYMBOL_GPL(sock_zerocopy_callback); void sock_zerocopy_put(struct ubuf_info *uarg) { - if (uarg && refcount_dec_and_test(&uarg->refcnt)) { - if (uarg->callback) - uarg->callback(uarg, uarg->zerocopy); - else - consume_skb(skb_from_uarg(uarg)); - } + if (uarg && refcount_dec_and_test(&uarg->refcnt)) + uarg->callback(uarg, uarg->zerocopy); } EXPORT_SYMBOL_GPL(sock_zerocopy_put);