[1381] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: st.o

daemon@ATHENA.MIT.EDU (Kai M{kisara)
Mon Feb 3 16:06:37 1997

Date: 	Mon, 3 Feb 1997 22:01:38 +0200 (EET)
From: Kai M{kisara <makisara@abies.metla.fi>
Reply-To: Kai.Makisara@metla.fi
To: Floody <flood@evcom.net>
cc: linux-scsi@vger.rutgers.edu
In-Reply-To: <Pine.LNX.3.95.970203101006.9066A-100000@ns1.evcom.net>

On Mon, 3 Feb 1997, Floody wrote:
...
> Details:
> 
> Determining and setting block size is accomplished in a variety of
> different manners, dependant on the device driver being used.
> 
> SCSI - The MTIOCGET ioctl() is used to retrieve block size.  The block
> size is returned in the *device dependant* status member of the mtget data
> structure.  This has the advantage of being quite standardized, and also
> working with rmt (assuming that the rmt protocol itself doesn't cause
> problems, which is *not* a good assumption, but that's phase 2 of my
> project).  MTIOCTOP is used to set the block size for the current media.
> 
The MTIOCGET ioctl returns the block size the drive reports. It is not the
best possible way to get the block size. Some drives don't recognize the
block size before the tape is being read. If the drive is in variable
block mode, block size zero is reported.

A quite good way to find out the block size is to set the drive to
variable block mode, try to read a large block, and see what you get. This
does not need any additional kernel support.

...
> SCSI Suggestion:
> 
> Using MTIOCTOP to set media block size seems intuitive, well documented
> and reasonable.  However, in the interest of future standardization, I
> recommend that an additional ioctl be added into the SCSI tape driver for
> the purposes of determining media volume information.  While it may not be
> possible to retrieve _all_ of the information (dependant on the physical
> device's capabilities), certainly _some_ of the information can be
> retrieved, and the rest set to a null (meaningless) value.  Again, in the
> interests of standardization, I recommend that MTIOCVOLINFO, already
> introduced by the popular zftape driver, be implemented in the SCSI tape
> driver.  Specifically (for those of you who don't have zftape):
> 
> struct mtvolinfo {
> 	int mt_volno;			/* vol-number */
> 	unsigned long mt_blksz;		/* blocksize */
> 	unsigned long mt_rawsize;	/* raw tape space consumed */
> 	unsigned long mt_size;		/* volume size after decompression */
> 	int mt_cmpr;			/* this volume compressed? */
> };
> 
> #define MTIOCVOLINFO	_IOR('m', 8, struct mtvolinfo) /* info about volume */
> 
This ioctl is specific to Linux and may not be the best possible for all
of the tape types. As you say, it does not give any new information about
SCSI tapes.

Instead of making a new ioctl (which adds kernel code), why not make a
tape access library that uses the existing interfaces. The library could
support also other Unices (and maybe other operating systems, too) and
this would make the tape access library much more useful for programs than
a method that works only in Linux.

If you generalize rmt so that ioctls can be reliably used in heterogenous
environment, that would be very welcome :-)

	Kai


home help back first fref pref prev next nref lref last post