summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-05-27 16:56:47 -0700
committerDavid S. Miller <davem@davemloft.net>2019-05-28 17:22:15 -0700
commit6b73d19711d0989cbdcd19c61faa0f79a1a5e466 (patch)
treed896cce4bf71785036333920ba40b885b208d280 /net/ipv4
parent3fb321fde22ddc3adc83e1f690b1fad9dfbd24ef (diff)
downloadlinux-stable-6b73d19711d0989cbdcd19c61faa0f79a1a5e466.tar.gz
linux-stable-6b73d19711d0989cbdcd19c61faa0f79a1a5e466.tar.bz2
linux-stable-6b73d19711d0989cbdcd19c61faa0f79a1a5e466.zip
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_fragment.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index 6ca9523374da..7c07aae969e6 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -154,6 +154,25 @@ static void fqdir_rwork_fn(struct work_struct *work)
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)
{
fqdir->high_thresh = 0; /* prevent creation of new frags */