aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-05-27 19:56:47 -0400
committerDavid S. Miller <davem@davemloft.net>2019-05-28 20:22:15 -0400
commit6b73d19711d0989cbdcd19c61faa0f79a1a5e466 (patch)
treed896cce4bf71785036333920ba40b885b208d280
parent3fb321fde22ddc3adc83e1f690b1fad9dfbd24ef (diff)
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>
-rw-r--r--include/net/inet_frag.h20
-rw-r--r--net/ipv4/inet_fragment.c19
2 files changed, 20 insertions, 19 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 002f23c1a1a7..94092b1ef22e 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -109,25 +109,7 @@ struct inet_frags {
109int inet_frags_init(struct inet_frags *); 109int inet_frags_init(struct inet_frags *);
110void inet_frags_fini(struct inet_frags *); 110void inet_frags_fini(struct inet_frags *);
111 111
112static inline int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, 112int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net);
113 struct net *net)
114{
115 struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL);
116 int res;
117
118 if (!fqdir)
119 return -ENOMEM;
120 fqdir->f = f;
121 fqdir->net = net;
122 res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params);
123 if (res < 0) {
124 kfree(fqdir);
125 return res;
126 }
127 *fqdirp = fqdir;
128 return 0;
129}
130
131void fqdir_exit(struct fqdir *fqdir); 113void fqdir_exit(struct fqdir *fqdir);
132 114
133void inet_frag_kill(struct inet_frag_queue *q); 115void inet_frag_kill(struct inet_frag_queue *q);
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)
154 kfree(fqdir); 154 kfree(fqdir);
155} 155}
156 156
157int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net)
158{
159 struct fqdir *fqdir = kzalloc(sizeof(*fqdir), GFP_KERNEL);
160 int res;
161
162 if (!fqdir)
163 return -ENOMEM;
164 fqdir->f = f;
165 fqdir->net = net;
166 res = rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params);
167 if (res < 0) {
168 kfree(fqdir);
169 return res;
170 }
171 *fqdirp = fqdir;
172 return 0;
173}
174EXPORT_SYMBOL(fqdir_init);
175
157void fqdir_exit(struct fqdir *fqdir) 176void fqdir_exit(struct fqdir *fqdir)
158{ 177{
159 fqdir->high_thresh = 0; /* prevent creation of new frags */ 178 fqdir->high_thresh = 0; /* prevent creation of new frags */