edac,rcu: use synchronize_rcu() instead of call_rcu()+rcu_barrier()

synchronize_rcu() does the stuff as needed.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Doug Thompson <dougthompson@xmission.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Lai Jiangshan
2011-05-26 16:25:58 -07:00
committed by Linus Torvalds
parent 26498e89e8
commit e2e7709876
4 changed files with 18 additions and 55 deletions

View File

@@ -345,31 +345,19 @@ fail1:
return 1;
}
/*
* complete_edac_device_list_del
*
* callback function when reference count is zero
*/
static void complete_edac_device_list_del(struct rcu_head *head)
{
struct edac_device_ctl_info *edac_dev;
edac_dev = container_of(head, struct edac_device_ctl_info, rcu);
INIT_LIST_HEAD(&edac_dev->link);
}
/*
* del_edac_device_from_global_list
*
* remove the RCU, setup for a callback call,
* then wait for the callback to occur
*/
static void del_edac_device_from_global_list(struct edac_device_ctl_info
*edac_device)
{
list_del_rcu(&edac_device->link);
call_rcu(&edac_device->rcu, complete_edac_device_list_del);
rcu_barrier();
/* these are for safe removal of devices from global list while
* NMI handlers may be traversing list
*/
synchronize_rcu();
INIT_LIST_HEAD(&edac_device->link);
}
/*