aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-03-23 14:12:50 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:42 -0400
commit9afdb00c80b0b9c20435ce690b5287fa2434ef44 (patch)
treebba4c192ee9e09ef630e1688e21f32a742b1cd57 /net
parent370e6a878962cad614eb8c7c5a22240e5cd316bb (diff)
[NETFILTER]: nfnetlink_log: remove conditional locking
This is gross, have the wrapper function take the lock. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nfnetlink_log.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 34de3d84e2fc..0ae06561ae9a 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -195,20 +195,14 @@ out_unlock:
195static int __nfulnl_send(struct nfulnl_instance *inst); 195static int __nfulnl_send(struct nfulnl_instance *inst);
196 196
197static void 197static void
198_instance_destroy2(struct nfulnl_instance *inst, int lock) 198__instance_destroy(struct nfulnl_instance *inst)
199{ 199{
200 /* first pull it out of the global list */ 200 /* first pull it out of the global list */
201 if (lock)
202 write_lock_bh(&instances_lock);
203
204 UDEBUG("removing instance %p (queuenum=%u) from hash\n", 201 UDEBUG("removing instance %p (queuenum=%u) from hash\n",
205 inst, inst->group_num); 202 inst, inst->group_num);
206 203
207 hlist_del(&inst->hlist); 204 hlist_del(&inst->hlist);
208 205
209 if (lock)
210 write_unlock_bh(&instances_lock);
211
212 /* then flush all pending packets from skb */ 206 /* then flush all pending packets from skb */
213 207
214 spin_lock_bh(&inst->lock); 208 spin_lock_bh(&inst->lock);
@@ -230,15 +224,11 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
230} 224}
231 225
232static inline void 226static inline void
233__instance_destroy(struct nfulnl_instance *inst)
234{
235 _instance_destroy2(inst, 0);
236}
237
238static inline void
239instance_destroy(struct nfulnl_instance *inst) 227instance_destroy(struct nfulnl_instance *inst)
240{ 228{
241 _instance_destroy2(inst, 1); 229 write_lock_bh(&instances_lock);
230 __instance_destroy(inst);
231 write_unlock_bh(&instances_lock);
242} 232}
243 233
244static int 234static int