mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 23:52:40 +00:00
[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>
This commit is contained in:
parent
51490c89f9
commit
53c165e0a6
2 changed files with 31 additions and 24 deletions
|
@ -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 *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue