mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[NET]: Clean up skb_linearize
The linearisation operation doesn't need to be super-optimised. So we can replace __skb_linearize with __pskb_pull_tail which does the same thing but is more general. Also, most users of skb_linearize end up testing whether the skb is linear or not so it helps to make skb_linearize do just that. Some callers of skb_linearize also use it to copy cloned data, so it's useful to have a new function skb_linearize_cow to copy the data if it's either non-linear or cloned. Last but not least, I've removed the gfp argument since nobody uses it anymore. If it's ever needed we can easily add it back. Misc bugs fixed by this patch: * via-velocity error handling (also, no SG => no frags) Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
932ff279a4
commit
364c6badde
9 changed files with 39 additions and 91 deletions
|
|
@ -801,8 +801,7 @@ got_it:
|
|||
* We linearize everything except data segments here.
|
||||
*/
|
||||
if (cb->nsp_flags & ~0x60) {
|
||||
if (unlikely(skb_is_nonlinear(skb)) &&
|
||||
skb_linearize(skb, GFP_ATOMIC) != 0)
|
||||
if (unlikely(skb_linearize(skb)))
|
||||
goto free_out;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -629,8 +629,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
|
|||
padlen);
|
||||
|
||||
if (flags & DN_RT_PKT_CNTL) {
|
||||
if (unlikely(skb_is_nonlinear(skb)) &&
|
||||
skb_linearize(skb, GFP_ATOMIC) != 0)
|
||||
if (unlikely(skb_linearize(skb)))
|
||||
goto dump_it;
|
||||
|
||||
switch(flags & DN_RT_CNTL_MSK) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue