diff options
Diffstat (limited to 'net/ipv4/inet_fragment.c')
-rw-r--r-- | net/ipv4/inet_fragment.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 57e15fa307dc..b531f803cda4 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -173,7 +173,7 @@ int inet_frag_evictor(struct inet_frags *f) | |||
173 | } | 173 | } |
174 | EXPORT_SYMBOL(inet_frag_evictor); | 174 | EXPORT_SYMBOL(inet_frag_evictor); |
175 | 175 | ||
176 | struct inet_frag_queue *inet_frag_intern(struct inet_frag_queue *qp_in, | 176 | static struct inet_frag_queue *inet_frag_intern(struct inet_frag_queue *qp_in, |
177 | struct inet_frags *f, unsigned int hash) | 177 | struct inet_frags *f, unsigned int hash) |
178 | { | 178 | { |
179 | struct inet_frag_queue *qp; | 179 | struct inet_frag_queue *qp; |
@@ -208,9 +208,8 @@ struct inet_frag_queue *inet_frag_intern(struct inet_frag_queue *qp_in, | |||
208 | write_unlock(&f->lock); | 208 | write_unlock(&f->lock); |
209 | return qp; | 209 | return qp; |
210 | } | 210 | } |
211 | EXPORT_SYMBOL(inet_frag_intern); | ||
212 | 211 | ||
213 | struct inet_frag_queue *inet_frag_alloc(struct inet_frags *f) | 212 | static struct inet_frag_queue *inet_frag_alloc(struct inet_frags *f, void *arg) |
214 | { | 213 | { |
215 | struct inet_frag_queue *q; | 214 | struct inet_frag_queue *q; |
216 | 215 | ||
@@ -218,6 +217,7 @@ struct inet_frag_queue *inet_frag_alloc(struct inet_frags *f) | |||
218 | if (q == NULL) | 217 | if (q == NULL) |
219 | return NULL; | 218 | return NULL; |
220 | 219 | ||
220 | f->constructor(q, arg); | ||
221 | atomic_add(f->qsize, &f->mem); | 221 | atomic_add(f->qsize, &f->mem); |
222 | setup_timer(&q->timer, f->frag_expire, (unsigned long)q); | 222 | setup_timer(&q->timer, f->frag_expire, (unsigned long)q); |
223 | spin_lock_init(&q->lock); | 223 | spin_lock_init(&q->lock); |
@@ -225,4 +225,16 @@ struct inet_frag_queue *inet_frag_alloc(struct inet_frags *f) | |||
225 | 225 | ||
226 | return q; | 226 | return q; |
227 | } | 227 | } |
228 | EXPORT_SYMBOL(inet_frag_alloc); | 228 | |
229 | struct inet_frag_queue *inet_frag_create(struct inet_frags *f, void *arg, | ||
230 | unsigned int hash) | ||
231 | { | ||
232 | struct inet_frag_queue *q; | ||
233 | |||
234 | q = inet_frag_alloc(f, arg); | ||
235 | if (q == NULL) | ||
236 | return NULL; | ||
237 | |||
238 | return inet_frag_intern(q, f, hash); | ||
239 | } | ||
240 | EXPORT_SYMBOL(inet_frag_create); | ||