Phonet: convert devices list to RCU
Subsystems (3)
RFC PATCH 1/1 Phonet: convert devices list to RCU
From: Rémi Denis-Courmont <[email protected]>
Signed-off-by Rémi Denis-Courmont <[email protected]>
--- include/net/phonet/pn_dev.h | 2 +- net/phonet/pn_dev.c | 63 ++++++++++++++++++++++++++++--------------- net/phonet/pn_netlink.c | 6 ++-- 3 files changed, 45 insertions(+), 26 deletions(-)
include/net/phonet/pn_dev.h +1 -1
@@ -25,7 +25,7 @@struct phonet_device_list {struct list_head list; -spinlock_t lock; +struct mutex lock; };struct phonet_device_list *phonet_device_list (struct net *net);
net/phonet/pn_dev.c +41 -22
156 lines not on this page · raw message
net/phonet/pn_netlink.c +3 -3
@@ -131,8 +131,8 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)int addr_idx =0 , addr_start_idx = cb->args[1 ]; pndevs =phonet_device_list (sock_net (skb->sk)); -spin_lock_bh (&pndevs->lock); -list_for_each_entry (pnd, &pndevs->list, list) { +rcu_read_lock (); +list_for_each_entry_rcu (pnd, &pndevs->list, list) {u8 addr;if (dev_idx > dev_start_idx)
@@ -154,7 +154,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb) } out: -spin_unlock_bh (&pndevs->lock); +rcu_read_unlock (); cb->args[0 ] = dev_idx; cb->args[1 ] = addr_idx;
Signature · 1 line
1.6.3.3
David Miller
maintainerFrom: Rémi Denis-Courmont <[email protected]>
Date: Tue, 17 Nov 2009 15:02:36 +0200
Quoted 3 lines
From: Rémi Denis-Courmont <[email protected]>
Signed-off-by Rémi Denis-Courmont <[email protected]>
Looks good, applied, thanks.