mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
[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>
This commit is contained in:
parent
370e6a8789
commit
9afdb00c80
1 changed files with 4 additions and 14 deletions
|
@ -195,20 +195,14 @@ instance_create(u_int16_t group_num, int pid)
|
||||||
static int __nfulnl_send(struct nfulnl_instance *inst);
|
static int __nfulnl_send(struct nfulnl_instance *inst);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_instance_destroy2(struct nfulnl_instance *inst, int lock)
|
__instance_destroy(struct nfulnl_instance *inst)
|
||||||
{
|
{
|
||||||
/* first pull it out of the global list */
|
/* first pull it out of the global list */
|
||||||
if (lock)
|
|
||||||
write_lock_bh(&instances_lock);
|
|
||||||
|
|
||||||
UDEBUG("removing instance %p (queuenum=%u) from hash\n",
|
UDEBUG("removing instance %p (queuenum=%u) from hash\n",
|
||||||
inst, inst->group_num);
|
inst, inst->group_num);
|
||||||
|
|
||||||
hlist_del(&inst->hlist);
|
hlist_del(&inst->hlist);
|
||||||
|
|
||||||
if (lock)
|
|
||||||
write_unlock_bh(&instances_lock);
|
|
||||||
|
|
||||||
/* then flush all pending packets from skb */
|
/* then flush all pending packets from skb */
|
||||||
|
|
||||||
spin_lock_bh(&inst->lock);
|
spin_lock_bh(&inst->lock);
|
||||||
|
@ -229,16 +223,12 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
|
||||||
instance_put(inst);
|
instance_put(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
__instance_destroy(struct nfulnl_instance *inst)
|
|
||||||
{
|
|
||||||
_instance_destroy2(inst, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
instance_destroy(struct nfulnl_instance *inst)
|
instance_destroy(struct nfulnl_instance *inst)
|
||||||
{
|
{
|
||||||
_instance_destroy2(inst, 1);
|
write_lock_bh(&instances_lock);
|
||||||
|
__instance_destroy(inst);
|
||||||
|
write_unlock_bh(&instances_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in a new issue