summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-01-05 00:42:48 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-01-05 00:42:48 +0000
commit1091d74b64109d8e398d4f4cfe8a6f8bbbe16368 (patch)
treec3472c5f29377a2e69f570fe27c125d07c5ca25f /sys
parent31d565416ae6377fdf35fc09eca42d18d051ba2c (diff)
As first brought to my attention by Russel Sutherland, our deletion of
the mt_fileno and mt_blkno fields from the mtget struct was too hasty. Subsequent discussions with Kern Sibbold of the Bacula project revealed these are widely used by tape backup software on many unicies. The de facto standard is to return -1 if you can't determine the value. So add them back and always return -1 as their value. Should allow Bacula and similar software to at least compile while we investigate providing meaningful values. ok beck@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/st.c4
-rw-r--r--sys/sys/mtio.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 810e420c3ec..99bba3b8438 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.70 2006/12/21 02:05:46 krw Exp $ */
+/* $OpenBSD: st.c,v 1.71 2007/01/05 00:42:47 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -1076,6 +1076,8 @@ stioctl(dev, cmd, arg, flag, p)
g->mt_dsreg |= MT_DS_MOUNTED;
g->mt_resid = st->mt_resid;
g->mt_erreg = st->mt_erreg;
+ g->mt_fileno = -1; /* -1 means we don't know */
+ g->mt_blkno = -1; /* -1 means we don't know */
/*
* clear latched errors.
*/
diff --git a/sys/sys/mtio.h b/sys/sys/mtio.h
index 4517e64d6e0..e2e57e97307 100644
--- a/sys/sys/mtio.h
+++ b/sys/sys/mtio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtio.h,v 1.7 2006/06/01 05:42:01 krw Exp $ */
+/* $OpenBSD: mtio.h,v 1.8 2007/01/05 00:42:47 krw Exp $ */
/* $NetBSD: mtio.h,v 1.14 1997/04/15 06:50:19 lukem Exp $ */
/*
@@ -72,6 +72,8 @@ struct mtget {
short mt_erreg; /* ``error'' register */
/* end device-dependent registers */
short mt_resid; /* residual count */
+ daddr_t mt_fileno; /* current file number relative to BOT. */
+ daddr_t mt_blkno; /* current block number relative to BOF. */
daddr_t mt_blksiz; /* current block size */
daddr_t mt_density; /* current density code */
daddr_t mt_mblksiz; /* default block size */