summaryrefslogtreecommitdiffstats
path: root/sys/scsi/sd.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-04-22 10:25:27 +0000
committerjulian <julian@FreeBSD.org>1998-04-22 10:25:27 +0000
commitdb37f632a083922cf897d2643cc01bca4ebff768 (patch)
treef9fe78dbd70b3d36af499750acc24a6235a6fa5f /sys/scsi/sd.c
parent2fe90b3e8973616fd8f5635f2897c83ae98dce83 (diff)
downloadFreeBSD-src-db37f632a083922cf897d2643cc01bca4ebff768.zip
FreeBSD-src-db37f632a083922cf897d2643cc01bca4ebff768.tar.gz
close() is no longer a SLICE method.
Close is simply an open with no-read and no-write once internal to SLICE (it still exports a close to the rest of the kernel)
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r--sys/scsi/sd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index a5d6236..7b168cc 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.123 1998/04/17 22:37:10 des Exp $
+ * $Id: sd.c,v 1.124 1998/04/19 23:32:36 julian Exp $
*/
#include "opt_bounce.h"
@@ -36,6 +36,7 @@
#include <sys/devfsext.h>
#ifdef SLICE
#include <sys/device.h>
+#include <sys/fcntl.h>
#include <dev/slice/slice.h>
#endif /* SLICE */
#endif /* DEVFS */
@@ -141,7 +142,7 @@ static struct bdevsw sd_bdevsw =
static sl_h_IO_req_t sdsIOreq; /* IO req downward (to device) */
static sl_h_ioctl_t sdsioctl; /* ioctl req downward (to device) */
static sl_h_open_t sdsopen; /* downwards travelling open */
-static sl_h_close_t sdsclose; /* downwards travelling close */
+/*static sl_h_close_t sdsclose; */ /* downwards travelling close */
static void sds_init (void *arg);
static struct slice_handler slicetype = {
@@ -153,7 +154,7 @@ static struct slice_handler slicetype = {
&sdsIOreq,
&sdsioctl,
&sdsopen,
- &sdsclose,
+ /*&sdsclose*/NULL,
NULL, /* revoke */
NULL, /* claim */
NULL, /* verify */
@@ -1283,9 +1284,14 @@ sdsopen(void *private, int flags, int mode, struct proc *p)
sd = private;
- return(sdopen(makedev(0,sd->mynor), 0 , 0, p));
+ if ((flags & (FREAD|FWRITE)) == 0) {
+ return(sdclose(makedev(0,sd->mynor), 0 , 0, p));
+ } else {
+ return(sdopen(makedev(0,sd->mynor), 0 , 0, p));
+ }
}
+#if 0
static void
sdsclose(void *private, int flags, int mode, struct proc *p)
{
@@ -1296,6 +1302,7 @@ sdsclose(void *private, int flags, int mode, struct proc *p)
sdclose(makedev(0,sd->mynor), 0 , 0, p);
return;
}
+#endif /* 0 */
static int
sdsioctl( void *private, int cmd, caddr_t addr, int flag, struct proc *p)
{
OpenPOWER on IntegriCloud