diff options
author | Eric Dumazet <edumazet@google.com> | 2019-05-27 19:56:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-28 20:22:15 -0400 |
commit | 6b73d19711d0989cbdcd19c61faa0f79a1a5e466 (patch) | |
tree | d896cce4bf71785036333920ba40b885b208d280 | |
parent | 3fb321fde22ddc3adc83e1f690b1fad9dfbd24ef (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.h | 20 | ||||
-rw-r--r-- | net/ipv4/inet_fragment.c | 19 |
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 { | |||
109 | int inet_frags_init(struct inet_frags *); | 109 | int inet_frags_init(struct inet_frags *); |
110 | void inet_frags_fini(struct inet_frags *); | 110 | void inet_frags_fini(struct inet_frags *); |
111 | 111 | ||
112 | static inline int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, | 112 | int 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 | |||
131 | void fqdir_exit(struct fqdir *fqdir); | 113 | void fqdir_exit(struct fqdir *fqdir); |
132 | 114 | ||
133 | void inet_frag_kill(struct inet_frag_queue *q); | 115 | void 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 | ||
157 | int 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 | } | ||
174 | EXPORT_SYMBOL(fqdir_init); | ||
175 | |||
157 | void fqdir_exit(struct fqdir *fqdir) | 176 | void 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 */ |