Commit d8cf757f authored by Peter Oskolkov's avatar Peter Oskolkov Committed by David S. Miller

net: remove unused struct inet_frag_queue.fragments field

Now that all users of struct inet_frag_queue have been converted
to use 'rb_fragments', remove the unused 'fragments' field.

Build with `make allyesconfig` succeeded. ip_defrag selftest passed.
Signed-off-by: default avatarPeter Oskolkov <posk@google.com>
Acked-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c14f7e1e
...@@ -56,7 +56,6 @@ struct frag_v6_compare_key { ...@@ -56,7 +56,6 @@ struct frag_v6_compare_key {
* @timer: queue expiration timer * @timer: queue expiration timer
* @lock: spinlock protecting this frag * @lock: spinlock protecting this frag
* @refcnt: reference count of the queue * @refcnt: reference count of the queue
* @fragments: received fragments head
* @rb_fragments: received fragments rb-tree root * @rb_fragments: received fragments rb-tree root
* @fragments_tail: received fragments tail * @fragments_tail: received fragments tail
* @last_run_head: the head of the last "run". see ip_fragment.c * @last_run_head: the head of the last "run". see ip_fragment.c
...@@ -77,8 +76,7 @@ struct inet_frag_queue { ...@@ -77,8 +76,7 @@ struct inet_frag_queue {
struct timer_list timer; struct timer_list timer;
spinlock_t lock; spinlock_t lock;
refcount_t refcnt; refcount_t refcnt;
struct sk_buff *fragments; /* used in 6lopwpan IPv6. */ struct rb_root rb_fragments;
struct rb_root rb_fragments; /* Used in IPv4/IPv6. */
struct sk_buff *fragments_tail; struct sk_buff *fragments_tail;
struct sk_buff *last_run_head; struct sk_buff *last_run_head;
ktime_t stamp; ktime_t stamp;
......
...@@ -179,7 +179,6 @@ static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, struct sk_buff *skb, ...@@ -179,7 +179,6 @@ static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, struct sk_buff *skb,
skb->dev = ldev; skb->dev = ldev;
skb->tstamp = fq->q.stamp; skb->tstamp = fq->q.stamp;
fq->q.fragments = NULL;
fq->q.rb_fragments = RB_ROOT; fq->q.rb_fragments = RB_ROOT;
fq->q.fragments_tail = NULL; fq->q.fragments_tail = NULL;
fq->q.last_run_head = NULL; fq->q.last_run_head = NULL;
......
...@@ -203,7 +203,6 @@ EXPORT_SYMBOL(inet_frag_rbtree_purge); ...@@ -203,7 +203,6 @@ EXPORT_SYMBOL(inet_frag_rbtree_purge);
void inet_frag_destroy(struct inet_frag_queue *q) void inet_frag_destroy(struct inet_frag_queue *q)
{ {
struct sk_buff *fp;
struct netns_frags *nf; struct netns_frags *nf;
unsigned int sum, sum_truesize = 0; unsigned int sum, sum_truesize = 0;
struct inet_frags *f; struct inet_frags *f;
...@@ -212,20 +211,9 @@ void inet_frag_destroy(struct inet_frag_queue *q) ...@@ -212,20 +211,9 @@ void inet_frag_destroy(struct inet_frag_queue *q)
WARN_ON(del_timer(&q->timer) != 0); WARN_ON(del_timer(&q->timer) != 0);
/* Release all fragment data. */ /* Release all fragment data. */
fp = q->fragments;
nf = q->net; nf = q->net;
f = nf->f; f = nf->f;
if (fp) {
do {
struct sk_buff *xp = fp->next;
sum_truesize += fp->truesize;
kfree_skb(fp);
fp = xp;
} while (fp);
} else {
sum_truesize = inet_frag_rbtree_purge(&q->rb_fragments); sum_truesize = inet_frag_rbtree_purge(&q->rb_fragments);
}
sum = sum_truesize + f->qsize; sum = sum_truesize + f->qsize;
call_rcu(&q->rcu, inet_frag_destroy_rcu); call_rcu(&q->rcu, inet_frag_destroy_rcu);
...@@ -489,13 +477,7 @@ EXPORT_SYMBOL(inet_frag_reasm_finish); ...@@ -489,13 +477,7 @@ EXPORT_SYMBOL(inet_frag_reasm_finish);
struct sk_buff *inet_frag_pull_head(struct inet_frag_queue *q) struct sk_buff *inet_frag_pull_head(struct inet_frag_queue *q)
{ {
struct sk_buff *head; struct sk_buff *head, *skb;
if (q->fragments) {
head = q->fragments;
q->fragments = head->next;
} else {
struct sk_buff *skb;
head = skb_rb_first(&q->rb_fragments); head = skb_rb_first(&q->rb_fragments);
if (!head) if (!head)
...@@ -508,7 +490,7 @@ struct sk_buff *inet_frag_pull_head(struct inet_frag_queue *q) ...@@ -508,7 +490,7 @@ struct sk_buff *inet_frag_pull_head(struct inet_frag_queue *q)
rb_erase(&head->rbnode, &q->rb_fragments); rb_erase(&head->rbnode, &q->rb_fragments);
memset(&head->rbnode, 0, sizeof(head->rbnode)); memset(&head->rbnode, 0, sizeof(head->rbnode));
barrier(); barrier();
}
if (head == q->fragments_tail) if (head == q->fragments_tail)
q->fragments_tail = NULL; q->fragments_tail = NULL;
......
...@@ -261,7 +261,6 @@ static int ip_frag_reinit(struct ipq *qp) ...@@ -261,7 +261,6 @@ static int ip_frag_reinit(struct ipq *qp)
qp->q.flags = 0; qp->q.flags = 0;
qp->q.len = 0; qp->q.len = 0;
qp->q.meat = 0; qp->q.meat = 0;
qp->q.fragments = NULL;
qp->q.rb_fragments = RB_ROOT; qp->q.rb_fragments = RB_ROOT;
qp->q.fragments_tail = NULL; qp->q.fragments_tail = NULL;
qp->q.last_run_head = NULL; qp->q.last_run_head = NULL;
...@@ -451,7 +450,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb, ...@@ -451,7 +450,6 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,
ip_send_check(iph); ip_send_check(iph);
__IP_INC_STATS(net, IPSTATS_MIB_REASMOKS); __IP_INC_STATS(net, IPSTATS_MIB_REASMOKS);
qp->q.fragments = NULL;
qp->q.rb_fragments = RB_ROOT; qp->q.rb_fragments = RB_ROOT;
qp->q.fragments_tail = NULL; qp->q.fragments_tail = NULL;
qp->q.last_run_head = NULL; qp->q.last_run_head = NULL;
......
...@@ -365,7 +365,6 @@ static int nf_ct_frag6_reasm(struct frag_queue *fq, struct sk_buff *skb, ...@@ -365,7 +365,6 @@ static int nf_ct_frag6_reasm(struct frag_queue *fq, struct sk_buff *skb,
skb_network_header_len(skb), skb_network_header_len(skb),
skb->csum); skb->csum);
fq->q.fragments = NULL;
fq->q.rb_fragments = RB_ROOT; fq->q.rb_fragments = RB_ROOT;
fq->q.fragments_tail = NULL; fq->q.fragments_tail = NULL;
fq->q.last_run_head = NULL; fq->q.last_run_head = NULL;
......
...@@ -304,7 +304,6 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *skb, ...@@ -304,7 +304,6 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *skb,
rcu_read_lock(); rcu_read_lock();
__IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS); __IP6_INC_STATS(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
rcu_read_unlock(); rcu_read_unlock();
fq->q.fragments = NULL;
fq->q.rb_fragments = RB_ROOT; fq->q.rb_fragments = RB_ROOT;
fq->q.fragments_tail = NULL; fq->q.fragments_tail = NULL;
fq->q.last_run_head = NULL; fq->q.last_run_head = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment