فهرست منبع

net,rcu: convert call_rcu(xt_osf_finger_free_rcu) to kfree_rcu()

The rcu callback xt_osf_finger_free_rcu() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(xt_osf_finger_free_rcu).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Lai Jiangshan 14 سال پیش
والد
کامیت
88b4a0347a
1فایلهای تغییر یافته به همراه2 افزوده شده و 9 حذف شده
  1. 2 9
      net/netfilter/xt_osf.c

+ 2 - 9
net/netfilter/xt_osf.c

@@ -62,13 +62,6 @@ static const struct nla_policy xt_osf_policy[OSF_ATTR_MAX + 1] = {
 	[OSF_ATTR_FINGER]	= { .len = sizeof(struct xt_osf_user_finger) },
 	[OSF_ATTR_FINGER]	= { .len = sizeof(struct xt_osf_user_finger) },
 };
 };
 
 
-static void xt_osf_finger_free_rcu(struct rcu_head *rcu_head)
-{
-	struct xt_osf_finger *f = container_of(rcu_head, struct xt_osf_finger, rcu_head);
-
-	kfree(f);
-}
-
 static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb,
 static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb,
 			       const struct nlmsghdr *nlh,
 			       const struct nlmsghdr *nlh,
 			       const struct nlattr * const osf_attrs[])
 			       const struct nlattr * const osf_attrs[])
@@ -133,7 +126,7 @@ static int xt_osf_remove_callback(struct sock *ctnl, struct sk_buff *skb,
 		 * We are protected by nfnl mutex.
 		 * We are protected by nfnl mutex.
 		 */
 		 */
 		list_del_rcu(&sf->finger_entry);
 		list_del_rcu(&sf->finger_entry);
-		call_rcu(&sf->rcu_head, xt_osf_finger_free_rcu);
+		kfree_rcu(sf, rcu_head);
 
 
 		err = 0;
 		err = 0;
 		break;
 		break;
@@ -414,7 +407,7 @@ static void __exit xt_osf_fini(void)
 
 
 		list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) {
 		list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) {
 			list_del_rcu(&f->finger_entry);
 			list_del_rcu(&f->finger_entry);
-			call_rcu(&f->rcu_head, xt_osf_finger_free_rcu);
+			kfree_rcu(f, rcu_head);
 		}
 		}
 	}
 	}
 	rcu_read_unlock();
 	rcu_read_unlock();