aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 19:45:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 19:45:38 -0800
commite49aedb594dc9cd4add2f0fd7360952c11017532 (patch)
treed29262a962727020206abd9b4cba70c47041476a /drivers/ide/ide-tape.c
parent4ef58d4e2ad1fa2a3e5bbf41af2284671fca8cf8 (diff)
parent4e5b932c829e9a6bf32ec80c6e1ce60121eef124 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6: sl82c105: remove no longer needed debugging code sis5513: remove stale TODO pdc202xx_old: remove no longer needed debugging code cy82c693: remove no longer needed debugging code cmd64x: remove no longer needed debugging code alim15x3: remove obsolete and dangerous wdc_udma parameter ide: Increase WAIT_DRQ to accomodate some CF cards and SSD drives. cs5535: add pci id for AMD based CS5535 controllers slc90e66: fix UDMA handling drivers/ide/tx4938ide.c: use resource_size() drivers/ide/ide_platform.c: use resource_size() drivers/ide/au1xxx-ide.c: use resource_size() hpt366: remove dead old timing tables ide: update Kconfig text to mark as deprecated ide-tape: remove the BKL hpt366: kill unused #define's
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 58fc920d5c3..6a0e6254216 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -221,6 +221,8 @@ typedef struct ide_tape_obj {
static DEFINE_MUTEX(idetape_ref_mutex);
+static DEFINE_MUTEX(idetape_chrdev_mutex);
+
static struct class *idetape_sysfs_class;
static void ide_tape_release(struct device *);
@@ -1457,10 +1459,11 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
if (i >= MAX_HWIFS * MAX_DRIVES)
return -ENXIO;
- lock_kernel();
+ mutex_lock(&idetape_chrdev_mutex);
+
tape = ide_tape_get(NULL, true, i);
if (!tape) {
- unlock_kernel();
+ mutex_unlock(&idetape_chrdev_mutex);
return -ENXIO;
}
@@ -1519,12 +1522,15 @@ static int idetape_chrdev_open(struct inode *inode, struct file *filp)
tape->door_locked = DOOR_LOCKED;
}
}
- unlock_kernel();
+ mutex_unlock(&idetape_chrdev_mutex);
+
return 0;
out_put_tape:
ide_tape_put(tape);
- unlock_kernel();
+
+ mutex_unlock(&idetape_chrdev_mutex);
+
return retval;
}
@@ -1551,7 +1557,8 @@ static int idetape_chrdev_release(struct inode *inode, struct file *filp)
ide_drive_t *drive = tape->drive;
unsigned int minor = iminor(inode);
- lock_kernel();
+ mutex_lock(&idetape_chrdev_mutex);
+
tape = drive->driver_data;
ide_debug_log(IDE_DBG_FUNC, "enter");
@@ -1575,7 +1582,9 @@ static int idetape_chrdev_release(struct inode *inode, struct file *filp)
}
clear_bit(ilog2(IDE_AFLAG_BUSY), &drive->atapi_flags);
ide_tape_put(tape);
- unlock_kernel();
+
+ mutex_unlock(&idetape_chrdev_mutex);
+
return 0;
}