diff options
| author | Patrick McHardy <kaber@trash.net> | 2007-03-23 14:12:50 -0400 |
|---|---|---|
| committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:27:42 -0400 |
| commit | 9afdb00c80b0b9c20435ce690b5287fa2434ef44 (patch) | |
| tree | bba4c192ee9e09ef630e1688e21f32a742b1cd57 | |
| parent | 370e6a878962cad614eb8c7c5a22240e5cd316bb (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>
| -rw-r--r-- | net/netfilter/nfnetlink_log.c | 18 |
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: | |||
| 195 | static int __nfulnl_send(struct nfulnl_instance *inst); | 195 | static int __nfulnl_send(struct nfulnl_instance *inst); |
| 196 | 196 | ||
| 197 | static void | 197 | static 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 | ||
| 232 | static inline void | 226 | static inline void |
| 233 | __instance_destroy(struct nfulnl_instance *inst) | ||
| 234 | { | ||
| 235 | _instance_destroy2(inst, 0); | ||
| 236 | } | ||
| 237 | |||
| 238 | static inline void | ||
| 239 | instance_destroy(struct nfulnl_instance *inst) | 227 | instance_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 | ||
| 244 | static int | 234 | static int |
