[NETFILTER]: nfnetlink_log: remove conditional locking
authorPatrick McHardy <kaber@trash.net>
Fri, 23 Mar 2007 18:12:50 +0000 (11:12 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:27:42 +0000 (22:27 -0700)
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>
net/netfilter/nfnetlink_log.c

index 34de3d84e2fc7139efacf035f2b04f92efd37ec9..0ae06561ae9acde2822e84666f29eb7f6dbb82ab 100644 (file)
@@ -195,20 +195,14 @@ out_unlock:
 static int __nfulnl_send(struct nfulnl_instance *inst);
 
 static void
-_instance_destroy2(struct nfulnl_instance *inst, int lock)
+__instance_destroy(struct nfulnl_instance *inst)
 {
        /* first pull it out of the global list */
-       if (lock)
-               write_lock_bh(&instances_lock);
-
        UDEBUG("removing instance %p (queuenum=%u) from hash\n",
                inst, inst->group_num);
 
        hlist_del(&inst->hlist);
 
-       if (lock)
-               write_unlock_bh(&instances_lock);
-
        /* then flush all pending packets from skb */
 
        spin_lock_bh(&inst->lock);
@@ -229,16 +223,12 @@ _instance_destroy2(struct nfulnl_instance *inst, int lock)
        instance_put(inst);
 }
 
-static inline void
-__instance_destroy(struct nfulnl_instance *inst)
-{
-       _instance_destroy2(inst, 0);
-}
-
 static inline void
 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