inet: frags: uninline fqdir_init()
fqdir_init() is not fast path and is getting bigger. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3fb321fde2
commit
6b73d19711
@ -109,25 +109,7 @@ struct inet_frags {
|
|||||||
int inet_frags_init(struct inet_frags *);
|
int inet_frags_init(struct inet_frags *);
|
||||||
void inet_frags_fini(struct inet_frags *);
|
void inet_frags_fini(struct inet_frags *);
|
||||||
|
|
||||||
static inline int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f,
|
int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net);
|
||||||
struct net *net)
|
|
||||||
{
|
|
||||||
struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL);
|
|
||||||
int res;
|
|
||||||
|
|
||||||
if (!fqdir)
|
|
||||||
return -ENOMEM;
|
|
||||||
fqdir->f = f;
|
|
||||||
fqdir->net = net;
|
|
||||||
res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params);
|
|
||||||
if (res < 0) {
|
|
||||||
kfree(fqdir);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*fqdirp = fqdir;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void fqdir_exit(struct fqdir *fqdir);
|
void fqdir_exit(struct fqdir *fqdir);
|
||||||
|
|
||||||
void inet_frag_kill(struct inet_frag_queue *q);
|
void inet_frag_kill(struct inet_frag_queue *q);
|
||||||
|
@ -154,6 +154,25 @@ static void fqdir_rwork_fn(struct work_struct *work)
|
|||||||
kfree(fqdir);
|
kfree(fqdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net)
|
||||||
|
{
|
||||||
|
struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL);
|
||||||
|
int res;
|
||||||
|
|
||||||
|
if (!fqdir)
|
||||||
|
return -ENOMEM;
|
||||||
|
fqdir->f = f;
|
||||||
|
fqdir->net = net;
|
||||||
|
res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params);
|
||||||
|
if (res < 0) {
|
||||||
|
kfree(fqdir);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
*fqdirp = fqdir;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(fqdir_init);
|
||||||
|
|
||||||
void fqdir_exit(struct fqdir *fqdir)
|
void fqdir_exit(struct fqdir *fqdir)
|
||||||
{
|
{
|
||||||
fqdir->high_thresh = 0; /* prevent creation of new frags */
|
fqdir->high_thresh = 0; /* prevent creation of new frags */
|
||||||
|
Loading…
Reference in New Issue
Block a user