Re: [PATCH 4/6] st: call scsi_set_medium_removal directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/30/2014 10:27 AM, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  drivers/scsi/st.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
> index 7d2e036..e46e02b2 100644
> --- a/drivers/scsi/st.c
> +++ b/drivers/scsi/st.c
> @@ -861,17 +861,16 @@ static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm)
>  /* Lock or unlock the drive door. Don't use when st_request allocated. */
>  static int do_door_lock(struct scsi_tape * STp, int do_lock)
>  {
> -	int retval, cmd;
> +	int retval;
>  
> -	cmd = do_lock ? SCSI_IOCTL_DOORLOCK : SCSI_IOCTL_DOORUNLOCK;
>  	DEBC_printk(STp, "%socking drive door.\n", do_lock ? "L" : "Unl");
> -	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;
> -	}
> -	else {
> +	else
>  		STp->door_locked = ST_LOCK_FAILS;
> -	}
>  	return retval;
>  }
>  
> 
Reviewed-by: Hannes Reinecke <hare@xxxxxxx>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@xxxxxxx			      +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux