aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_fragment.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-06-13 23:02:24 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-15 18:12:44 -0700
commitd27f9b35827ec91d71d3561c127a0a8135fb470d (patch)
treea6a9c67628bf3b807d8bf24375fe6c075b25af32 /net/ipv4/ip_fragment.c
parent2bbdf389a9432270147c8e8e35b021ad61772f65 (diff)
downloadkernel_samsung_tuna-d27f9b35827ec91d71d3561c127a0a8135fb470d.zip
kernel_samsung_tuna-d27f9b35827ec91d71d3561c127a0a8135fb470d.tar.gz
kernel_samsung_tuna-d27f9b35827ec91d71d3561c127a0a8135fb470d.tar.bz2
ip_frag: Remove some atomic ops
Instead of doing one atomic operation per frag, we can factorize them. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_fragment.c')
-rw-r--r--net/ipv4/ip_fragment.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 75347ea..963c368 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -556,7 +556,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
skb_shinfo(head)->frag_list = head->next;
skb_push(head, head->data - skb_network_header(head));
- atomic_sub(head->truesize, &qp->q.net->mem);
for (fp=head->next; fp; fp = fp->next) {
head->data_len += fp->len;
@@ -566,8 +565,8 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
else if (head->ip_summed == CHECKSUM_COMPLETE)
head->csum = csum_add(head->csum, fp->csum);
head->truesize += fp->truesize;
- atomic_sub(fp->truesize, &qp->q.net->mem);
}
+ atomic_sub(head->truesize, &qp->q.net->mem);
head->next = NULL;
head->dev = dev;