summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-11 22:17:48 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-11 22:17:48 +0000
commitb4802fd04a95be8a637b50af9c19b65dd1e7e65f (patch)
tree578d87b7b537fbfa14dea1ce338524aa799d645a /sys
parentf19480826f2a4375b663b588695599a93364ea79 (diff)
Make use of existing SCSI block reassign code.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/sd.c9
-rw-r--r--sys/sys/scsiio.h4
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 55cf4821a2f..fcda755c91e 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.15 1996/06/16 03:07:21 downsj Exp $ */
+/* $OpenBSD: sd.c,v 1.16 1996/07/11 22:17:46 pefo Exp $ */
/* $NetBSD: sd.c,v 1.100.4.1 1996/06/04 23:14:08 thorpej Exp $ */
/*
@@ -64,6 +64,7 @@
#include <sys/disk.h>
#include <sys/proc.h>
#include <sys/conf.h>
+#include <sys/scsiio.h>
#include <scsi/scsi_all.h>
#include <scsi/scsi_disk.h>
@@ -747,6 +748,12 @@ sdioctl(dev, cmd, addr, flag, p)
sd->sc_link->flags |= SDEV_EJECTING;
return 0;
+ case SCIOCREASSIGN:
+ if ((flag & FWRITE) == 0)
+ return EBADF;
+ error = sd_reassign_blocks(sd, *(*(int **)addr));
+ return error;
+
default:
if (SDPART(dev) != RAW_PART)
return ENOTTY;
diff --git a/sys/sys/scsiio.h b/sys/sys/scsiio.h
index 3b8942f511e..a96afed3522 100644
--- a/sys/sys/scsiio.h
+++ b/sys/sys/scsiio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiio.h,v 1.2 1996/03/03 12:12:15 niklas Exp $ */
+/* $OpenBSD: scsiio.h,v 1.3 1996/07/11 22:17:47 pefo Exp $ */
/* $NetBSD: scsiio.h,v 1.3 1994/06/29 06:45:09 cgd Exp $ */
#ifndef _SYS_SCSIIO_H_
@@ -60,6 +60,6 @@ struct scsi_addr {
#define SCIOCDECONFIG _IO('Q', 5) /* please dissappear */
#define SCIOCRECONFIG _IO('Q', 6) /* please check again */
#define SCIOCRESET _IO('Q', 7) /* reset the device */
-
+#define SCIOCREASSIGN _IO('Q', 8) /* reassign block */
#endif /* _SYS_SCSIIO_H_ */