READ, WRITE -> F_READ, F_WRITE
[unix-history] / usr / src / sys / tahoe / stand / vd.c
index 4411ed6..28ddbeb 100644 (file)
@@ -5,19 +5,9 @@
  * This code is derived from software contributed to Berkeley by
  * Computer Consoles Inc.
  *
  * This code is derived from software contributed to Berkeley by
  * Computer Consoles Inc.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  *
  *
- *     @(#)vd.c        7.13 (Berkeley) %G%
+ *     @(#)vd.c        7.18 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
  */
 #include "machine/mtpr.h"
 
  */
 #include "machine/mtpr.h"
 
-#include "param.h"
-#include "inode.h"
-#include "fs.h"
-#include "buf.h"
-#include "disklabel.h"
-#include "saio.h"
+#include "sys/param.h"
+#include "sys/time.h"
+#include "sys/buf.h"
+#include "sys/disklabel.h"
+#include "stand/saio.h"
 
 
-#include "../tahoevba/vdreg.h"
-#include "../tahoevba/vbaparam.h"
+#include "../vba/vdreg.h"
+#include "../vba/vbaparam.h"
 
 #define        COMPAT_42       1
 
 
 #define        COMPAT_42       1
 
@@ -86,7 +75,7 @@ vdopen(io)
                tio.i_ma = lbuf;
                tio.i_cc = DEV_BSIZE;
                tio.i_flgs |= F_RDDATA;
                tio.i_ma = lbuf;
                tio.i_cc = DEV_BSIZE;
                tio.i_flgs |= F_RDDATA;
-               if (vdstrategy(&tio, READ) != DEV_BSIZE)
+               if (vdstrategy(&tio, F_READ) != DEV_BSIZE)
                        return (ERDLAB);
                dlp = (struct disklabel *)(lbuf + LABELOFFSET);
                if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC)
                        return (ERDLAB);
                dlp = (struct disklabel *)(lbuf + LABELOFFSET);
                if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC)
@@ -270,7 +259,7 @@ vdstrategy(io, cmd)
        sn = sn % lp->d_nsectors;
 
 top:
        sn = sn % lp->d_nsectors;
 
 top:
-       dcb.opcode = (cmd == READ ? VDOP_RD : VDOP_WD);
+       dcb.opcode = (cmd == F_READ ? VDOP_RD : VDOP_WD);
        dcb.intflg = DCBINT_NONE;
        dcb.nxtdcb = (struct dcb *)0;   /* end of chain */
        dcb.operrsta  = 0;
        dcb.intflg = DCBINT_NONE;
        dcb.nxtdcb = (struct dcb *)0;   /* end of chain */
        dcb.operrsta  = 0;
@@ -293,7 +282,7 @@ top:
                if (retries++ == 0 && vdreset_ctlr(ctlr, io->i_unit) == 0 &&
                    vdreset_drive(io))
                        goto top;
                if (retries++ == 0 && vdreset_ctlr(ctlr, io->i_unit) == 0 &&
                    vdreset_drive(io))
                        goto top;
-               vderror(io->i_unit, cmd == READ ? "read" : "write", &dcb);
+               vderror(io->i_unit, cmd == F_READ ? "read" : "write", &dcb);
                io->i_error = EIO;
                return (-1);
        }
                io->i_error = EIO;
                return (-1);
        }