diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-05-02 21:09:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-03 13:18:37 -0400 |
commit | 3a7c1ee4ab89f9250b8f82656a7be0ae14aa3691 (patch) | |
tree | 9dc10e067f2364fd3590b38cd5db495cd09c32e6 /net/core/skbuff.c | |
parent | 715dc1f342713816d1be1c37643a2c9e6ee181a7 (diff) |
skb: Add skb_head_is_locked helper function
This patch adds support for a skb_head_is_locked helper function. It is
meant to be used any time we are considering transferring the head from
skb->head to a paged frag. If the head is locked it means we cannot remove
the head from the skb so it must be copied or we must take the skb as a
whole.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index e1f8bbaadf52..c199aa428c6d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1699,7 +1699,6 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe, | |||
1699 | struct splice_pipe_desc *spd, struct sock *sk) | 1699 | struct splice_pipe_desc *spd, struct sock *sk) |
1700 | { | 1700 | { |
1701 | int seg; | 1701 | int seg; |
1702 | bool head_is_locked = !skb->head_frag || skb_cloned(skb); | ||
1703 | 1702 | ||
1704 | /* map the linear part : | 1703 | /* map the linear part : |
1705 | * If skb->head_frag is set, this 'linear' part is backed by a | 1704 | * If skb->head_frag is set, this 'linear' part is backed by a |
@@ -1710,7 +1709,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe, | |||
1710 | (unsigned long) skb->data & (PAGE_SIZE - 1), | 1709 | (unsigned long) skb->data & (PAGE_SIZE - 1), |
1711 | skb_headlen(skb), | 1710 | skb_headlen(skb), |
1712 | offset, len, skb, spd, | 1711 | offset, len, skb, spd, |
1713 | head_is_locked, | 1712 | skb_head_is_locked(skb), |
1714 | sk, pipe)) | 1713 | sk, pipe)) |
1715 | return true; | 1714 | return true; |
1716 | 1715 | ||