This file contains brief information about the SCSI tape driver.
-The driver is currently maintained by Kai M{kisara (email
+The driver is currently maintained by Kai Mäkisara (email
Kai.Makisara@metla.fi)
-Last modified: Fri Jul 26 16:01:39 2002 by makisara
+Last modified: Sat Dec 14 14:35:30 2002 by makisara
BASICS
4. If the open option O_NONBLOCK is used, open succeeds even if the
drive is not ready. If O_NONBLOCK is not used, the driver waits for
the drive to become ready. If this does not happen in ST_BLOCK_SECONDS
-seconds, open fails with the errno value EIO.
+seconds, open fails with the errno value EIO. With O_NONBLOCK the
+device can be opened for writing even if there is a write protected
+tape in the drive (commands trying to write something return error if
+attempted).
BSD AND SYS V SEMANTICS
Copyright 1992 - 2002 Kai Makisara
email Kai.Makisara@metla.fi
- Last modified: Tue Oct 15 22:01:04 2002 by makisara
+ Last modified: Sat Dec 14 14:25:09 2002 by makisara
Some small formal changes - aeb, 950809
Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
*/
-static char *verstr = "20021015";
+static char *verstr = "20021214";
#include <linux/module.h>
DEBC(printk(ST_DEB_MSG "%s: Write protected\n", name));
- if ((st_flags & O_ACCMODE) == O_WRONLY ||
- (st_flags & O_ACCMODE) == O_RDWR) {
+ if (do_wait &&
+ ((st_flags & O_ACCMODE) == O_WRONLY ||
+ (st_flags & O_ACCMODE) == O_RDWR)) {
retval = (-EROFS);
goto err_out;
}
return (-EBUSY);
}
- if(!scsi_device_get(STp->device))
+ if(scsi_device_get(STp->device)) {
+ write_unlock(&st_dev_arr_lock);
return (-ENXIO);
+ }
STp->in_use = 1;
write_unlock(&st_dev_arr_lock);
STp->rew_at_close = STp->autorew_dev = (minor(inode->i_rdev) & 0x80) == 0;