aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-08-22 11:06:19 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-30 23:44:20 -0400
commit53c165e0a6c8a4ff7df316557528fa7a52d20711 (patch)
tree354c599a07c45c71da2b848a90bbe4a98c42d333 /include/linux
parent51490c89f95b8581782e9baa855da166441852be (diff)
[SCSI] correct attribute_container list usage
One of the changes in the attribute_container code in the scsi-misc tree was to add a lock to protect the list of devices per container. This, unfortunately, leads to potential scheduling while atomic problems if there's a sleep in the function called by a trigger. The correct solution is to use the kernel klist infrastructure instead which allows lockless traversal of a list. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/attribute_container.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index ee83fe64a102..93bfb0beb62a 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -11,12 +11,12 @@
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/klist.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
15 16
16struct attribute_container { 17struct attribute_container {
17 struct list_head node; 18 struct list_head node;
18 struct list_head containers; 19 struct klist containers;
19 spinlock_t containers_lock;
20 struct class *class; 20 struct class *class;
21 struct class_device_attribute **attrs; 21 struct class_device_attribute **attrs;
22 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);