Add lock_kernel() calls to ch_open(), though the existing locking looks
adequate.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
#include <linux/chio.h> /* here are all the ioctls */
#include <linux/mutex.h>
#include <linux/idr.h>
#include <linux/chio.h> /* here are all the ioctls */
#include <linux/mutex.h>
#include <linux/idr.h>
+#include <linux/smp_lock.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
scsi_changer *ch;
int minor = iminor(inode);
scsi_changer *ch;
int minor = iminor(inode);
spin_lock(&ch_index_lock);
ch = idr_find(&ch_index_idr, minor);
if (NULL == ch || scsi_device_get(ch->device)) {
spin_unlock(&ch_index_lock);
spin_lock(&ch_index_lock);
ch = idr_find(&ch_index_idr, minor);
if (NULL == ch || scsi_device_get(ch->device)) {
spin_unlock(&ch_index_lock);
return -ENXIO;
}
spin_unlock(&ch_index_lock);
file->private_data = ch;
return -ENXIO;
}
spin_unlock(&ch_index_lock);
file->private_data = ch;