mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 02:54:35 +00:00
osst: call scsi_set_medium_removal directly
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
This commit is contained in:
parent
dccfa688ca
commit
2b3b3d61e8
1 changed files with 6 additions and 7 deletions
|
@ -3327,19 +3327,18 @@ static int osst_write_frame(struct osst_tape * STp, struct osst_request ** aSRpn
|
||||||
/* Lock or unlock the drive door. Don't use when struct osst_request allocated. */
|
/* Lock or unlock the drive door. Don't use when struct osst_request allocated. */
|
||||||
static int do_door_lock(struct osst_tape * STp, int do_lock)
|
static int do_door_lock(struct osst_tape * STp, int do_lock)
|
||||||
{
|
{
|
||||||
int retval, cmd;
|
int retval;
|
||||||
|
|
||||||
cmd = do_lock ? SCSI_IOCTL_DOORLOCK : SCSI_IOCTL_DOORUNLOCK;
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
printk(OSST_DEB_MSG "%s:D: %socking drive door.\n", tape_name(STp), do_lock ? "L" : "Unl");
|
printk(OSST_DEB_MSG "%s:D: %socking drive door.\n", tape_name(STp), do_lock ? "L" : "Unl");
|
||||||
#endif
|
#endif
|
||||||
retval = scsi_ioctl(STp->device, cmd, NULL);
|
|
||||||
if (!retval) {
|
retval = scsi_set_medium_removal(STp->device,
|
||||||
|
do_lock ? SCSI_REMOVAL_PREVENT : SCSI_REMOVAL_ALLOW);
|
||||||
|
if (!retval)
|
||||||
STp->door_locked = do_lock ? ST_LOCKED_EXPLICIT : ST_UNLOCKED;
|
STp->door_locked = do_lock ? ST_LOCKED_EXPLICIT : ST_UNLOCKED;
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
STp->door_locked = ST_LOCK_FAILS;
|
STp->door_locked = ST_LOCK_FAILS;
|
||||||
}
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue