static __inline__ struct ipq *frag_alloc_queue(void)
{
- struct ipq *qp = kmalloc(sizeof(struct ipq), GFP_ATOMIC);
+ struct ipq *qp = kzalloc(sizeof(struct ipq), GFP_ATOMIC);
if (!qp)
return NULL;
/* Destruction primitives. */
-static __inline__ void ipq_put(struct ipq *ipq, int *work)
+static __inline__ void ipq_put(struct ipq *ipq)
{
- if (atomic_dec_and_test(&ipq->q.refcnt))
- inet_frag_destroy(&ipq->q, &ip4_frags, work);
+ inet_frag_put(&ipq->q, &ip4_frags);
}
/* Kill ipq entry. It is not destroyed immediately,
}
out:
spin_unlock(&qp->q.lock);
- ipq_put(qp, NULL);
+ ipq_put(qp);
}
/* Creation primitives. */
atomic_inc(&qp->q.refcnt);
write_unlock(&ip4_frags.lock);
qp_in->q.last_in |= COMPLETE;
- ipq_put(qp_in, NULL);
+ ipq_put(qp_in);
return qp;
}
}
goto out_nomem;
qp->protocol = iph->protocol;
- qp->q.last_in = 0;
qp->id = iph->id;
qp->saddr = iph->saddr;
qp->daddr = iph->daddr;
qp->user = user;
- qp->q.len = 0;
- qp->q.meat = 0;
- qp->q.fragments = NULL;
- qp->iif = 0;
qp->peer = sysctl_ipfrag_max_dist ? inet_getpeer(iph->saddr, 1) : NULL;
/* Initialize a timer for this entry. */
ret = ip_frag_queue(qp, skb);
spin_unlock(&qp->q.lock);
- ipq_put(qp, NULL);
+ ipq_put(qp);
return ret;
}