diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-08-22 19:06:19 +0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-08-31 07:44:20 +0400 |
commit | 53c165e0a6c8a4ff7df316557528fa7a52d20711 (patch) | |
tree | 354c599a07c45c71da2b848a90bbe4a98c42d333 /include/linux/attribute_container.h | |
parent | 51490c89f95b8581782e9baa855da166441852be (diff) | |
download | linux-53c165e0a6c8a4ff7df316557528fa7a52d20711.tar.xz |
[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/attribute_container.h')
-rw-r--r-- | include/linux/attribute_container.h | 4 |
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 @@ #include <linux/device.h> #include <linux/list.h> +#include <linux/klist.h> #include <linux/spinlock.h> struct attribute_container { struct list_head node; - struct list_head containers; - spinlock_t containers_lock; + struct klist containers; struct class *class; struct class_device_attribute **attrs; int (*match)(struct attribute_container *, struct device *); |