s390/tape: fix MTIOCGET ioctl to report blocksize
authorStefan Haberland <stefan.haberland@de.ibm.com>
Tue, 16 Sep 2014 09:02:24 +0000 (11:02 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Sep 2014 08:52:03 +0000 (10:52 +0200)
Remove tape_state from status register and report the drive's current
setting for block size instead as known from other tapes.
Density is not supported so nothing to report here.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/tape_char.c

index 6dc60725de92f704a15dd5c877410832221ec5b8..77f9b9c2f7019d822a5bb9b96459af51f169d67f 100644 (file)
@@ -402,7 +402,9 @@ __tapechar_ioctl(struct tape_device *device,
                memset(&get, 0, sizeof(get));
                get.mt_type = MT_ISUNKNOWN;
                get.mt_resid = 0 /* device->devstat.rescnt */;
-               get.mt_dsreg = device->tape_state;
+               get.mt_dsreg =
+                       ((device->char_data.block_size << MT_ST_BLKSIZE_SHIFT)
+                        & MT_ST_BLKSIZE_MASK);
                /* FIXME: mt_gstat, mt_erreg, mt_fileno */
                get.mt_gstat = 0;
                get.mt_erreg = 0;