st: Fix MTMKPART to work with newer drives

Change the MTMKPART operation of the MTIOCTOP ioctl so that it works
also with current drives (LTO-5/6, etc.). Send a separate FORMAT MEDIUM
command if the partition mode page indicates that this is required. Use
LOAD to position the tape at the beginning of tape.

The operation is extended so that if the argument is negative, its
absolute value specifies the size of partition 0, which is the
physically first partition of the tape.

Signed-off-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Tested-by: Shane M Seymour <shane.seymour@hpe.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Kai Makisara
2016-02-09 21:56:55 +02:00
committed by Martin K. Petersen
부모 ea1c928bb6
커밋 8038e6456a
2개의 변경된 파일121개의 추가작업 그리고 16개의 파일을 삭제

파일 보기

@@ -2,7 +2,7 @@ This file contains brief information about the SCSI tape driver.
The driver is currently maintained by Kai Mäkisara (email
Kai.Makisara@kolumbus.fi)
Last modified: Sun Aug 29 18:25:47 2010 by kai.makisara
Last modified: Tue Feb 9 21:54:16 2016 by kai.makisara
BASICS
@@ -408,10 +408,15 @@ MTSETPART Moves the tape to the partition given by the argument at the
specified by MTSEEK. MTSETPART is inactive unless
MT_ST_CAN_PARTITIONS set.
MTMKPART Formats the tape with one partition (argument zero) or two
partitions (the argument gives in megabytes the size of
partition 1 that is physically the first partition of the
tape). The drive has to support partitions with size specified
by the initiator. Inactive unless MT_ST_CAN_PARTITIONS set.
partitions (argument non-zero). If the argument is positive,
it specifies the size of partition 1 in megabytes. For DDS
drives and several early drives this is the physically first
partition of the tape. If the argument is negative, its absolute
value specifies the size of partition 0 in megabytes. This is
the physically first partition of many later drives, like the
LTO drives from LTO-5 upwards. The drive has to support partitions
with size specified by the initiator. Inactive unless
MT_ST_CAN_PARTITIONS set.
MTSETDRVBUFFER
Is used for several purposes. The command is obtained from count
with mask MT_SET_OPTIONS, the low order bits are used as argument.