aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.com>2012-09-10 18:36:44 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 05:07:02 -0400
commit0644f5393e915f13733bcc65f13195ff39aeb63e (patch)
tree83484a2a59264721238bb2c25a88aeb46f3740d1 /drivers/scsi
parentfe542396da73b7e2b0848618c7e95855c1b75689 (diff)
[SCSI] st: remove st_mutex
The st_mutex was created when the BKL was removed, and prevents simultaneous st_open calls. It is better to protect just the necessary data. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Lee Duncan <lduncan@suse.com> Acked-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/st.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index ceca095e5d8d..98156a97c472 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -75,7 +75,6 @@ static const char *verstr = "20101219";
75#include "st_options.h" 75#include "st_options.h"
76#include "st.h" 76#include "st.h"
77 77
78static DEFINE_MUTEX(st_mutex);
79static int buffer_kbs; 78static int buffer_kbs;
80static int max_sg_segs; 79static int max_sg_segs;
81static int try_direct_io = TRY_DIRECT_IO; 80static int try_direct_io = TRY_DIRECT_IO;
@@ -1185,7 +1184,6 @@ static int st_open(struct inode *inode, struct file *filp)
1185 int dev = TAPE_NR(inode); 1184 int dev = TAPE_NR(inode);
1186 char *name; 1185 char *name;
1187 1186
1188 mutex_lock(&st_mutex);
1189 /* 1187 /*
1190 * We really want to do nonseekable_open(inode, filp); here, but some 1188 * We really want to do nonseekable_open(inode, filp); here, but some
1191 * versions of tar incorrectly call lseek on tapes and bail out if that 1189 * versions of tar incorrectly call lseek on tapes and bail out if that
@@ -1194,7 +1192,6 @@ static int st_open(struct inode *inode, struct file *filp)
1194 filp->f_mode &= ~(FMODE_PREAD | FMODE_PWRITE); 1192 filp->f_mode &= ~(FMODE_PREAD | FMODE_PWRITE);
1195 1193
1196 if (!(STp = scsi_tape_get(dev))) { 1194 if (!(STp = scsi_tape_get(dev))) {
1197 mutex_unlock(&st_mutex);
1198 return -ENXIO; 1195 return -ENXIO;
1199 } 1196 }
1200 1197
@@ -1205,7 +1202,6 @@ static int st_open(struct inode *inode, struct file *filp)
1205 if (STp->in_use) { 1202 if (STp->in_use) {
1206 spin_unlock(&st_use_lock); 1203 spin_unlock(&st_use_lock);
1207 scsi_tape_put(STp); 1204 scsi_tape_put(STp);
1208 mutex_unlock(&st_mutex);
1209 DEB( printk(ST_DEB_MSG "%s: Device already in use.\n", name); ) 1205 DEB( printk(ST_DEB_MSG "%s: Device already in use.\n", name); )
1210 return (-EBUSY); 1206 return (-EBUSY);
1211 } 1207 }
@@ -1259,16 +1255,16 @@ static int st_open(struct inode *inode, struct file *filp)
1259 retval = (-EIO); 1255 retval = (-EIO);
1260 goto err_out; 1256 goto err_out;
1261 } 1257 }
1262 mutex_unlock(&st_mutex);
1263 return 0; 1258 return 0;
1264 1259
1265 err_out: 1260 err_out:
1266 normalize_buffer(STp->buffer); 1261 normalize_buffer(STp->buffer);
1262 spin_lock(&st_use_lock);
1267 STp->in_use = 0; 1263 STp->in_use = 0;
1264 spin_unlock(&st_use_lock);
1268 scsi_tape_put(STp); 1265 scsi_tape_put(STp);
1269 if (resumed) 1266 if (resumed)
1270 scsi_autopm_put_device(STp->device); 1267 scsi_autopm_put_device(STp->device);
1271 mutex_unlock(&st_mutex);
1272 return retval; 1268 return retval;
1273 1269
1274} 1270}