READ, WRITE -> F_READ, F_WRITE
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 5 May 1991 07:28:30 +0000 (23:28 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 5 May 1991 07:28:30 +0000 (23:28 -0800)
SCCS-vsn: sys/vax/stand/hp.c 7.13
SCCS-vsn: sys/vax/stand/ht.c 7.7
SCCS-vsn: sys/vax/stand/idc.c 7.7
SCCS-vsn: sys/vax/stand/kdb.c 7.9
SCCS-vsn: sys/vax/stand/mt.c 7.7
SCCS-vsn: sys/vax/stand/rk.c 7.10
SCCS-vsn: sys/vax/stand/rl.c 7.9
SCCS-vsn: sys/vax/stand/tm.c 7.8
SCCS-vsn: sys/vax/stand/tmscp.c 7.7
SCCS-vsn: sys/vax/stand/ts.c 7.8
SCCS-vsn: sys/vax/stand/uda.c 7.12
SCCS-vsn: sys/vax/stand/up.c 7.11
SCCS-vsn: sys/vax/stand/ut.c 7.8

13 files changed:
usr/src/sys/vax/stand/hp.c
usr/src/sys/vax/stand/ht.c
usr/src/sys/vax/stand/idc.c
usr/src/sys/vax/stand/kdb.c
usr/src/sys/vax/stand/mt.c
usr/src/sys/vax/stand/rk.c
usr/src/sys/vax/stand/rl.c
usr/src/sys/vax/stand/tm.c
usr/src/sys/vax/stand/tmscp.c
usr/src/sys/vax/stand/ts.c
usr/src/sys/vax/stand/uda.c
usr/src/sys/vax/stand/up.c
usr/src/sys/vax/stand/ut.c

index 83efefb..30ef019 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)hp.c        7.12 (Berkeley) %G%
+ *     @(#)hp.c        7.13 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -128,7 +128,7 @@ hpopen(io)
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
-               if (hpstrategy(&tio, READ) != SECTSIZ)
+               if (hpstrategy(&tio, F_READ) != SECTSIZ)
                        error = ERDLAB;
                dlp = (struct disklabel *)(lbuf + LABELOFFSET);
                if (error == 0 && (dlp->d_magic != DISKMAGIC ||
                        error = ERDLAB;
                dlp = (struct disklabel *)(lbuf + LABELOFFSET);
                if (error == 0 && (dlp->d_magic != DISKMAGIC ||
@@ -150,7 +150,7 @@ hpopen(io)
                tio.i_ma = (char *)&hpbad[io->i_adapt][unit];
                tio.i_cc = sizeof(struct dkbad);
                for (i = 0; i < 5; i++) {
                tio.i_ma = (char *)&hpbad[io->i_adapt][unit];
                tio.i_cc = sizeof(struct dkbad);
                for (i = 0; i < 5; i++) {
-                       if (hpstrategy(&tio, READ) == sizeof(struct dkbad))
+                       if (hpstrategy(&tio, F_READ) == sizeof(struct dkbad))
                                break;
                        tio.i_bn += 2;
                }
                                break;
                        tio.i_bn += 2;
                }
index f216a35..5f17aa6 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ht.c        7.6 (Berkeley) %G%
+ *     @(#)ht.c        7.7 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -80,7 +80,7 @@ retry:
                htaddr->htcs1 = HT_SREV|HT_GO;
                return (0);
        }
                htaddr->htcs1 = HT_SREV|HT_GO;
                return (0);
        }
-       if (func == READ || func == WRITE)
+       if (func == F_READ || func == F_WRITE)
                mbastart(io, io->i_ctlr, func);
        else
                htaddr->htcs1 = func|HT_GO;
                mbastart(io, io->i_ctlr, func);
        else
                htaddr->htcs1 = func|HT_GO;
index 438c6b2..002553a 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)idc.c       7.6 (Berkeley) %G%
+ *     @(#)idc.c       7.7 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -102,7 +102,7 @@ retry:
        idcwait(idcaddr);
        idcaddr->idccsr &= ~IDC_ATTN;
        com = dn<<8;
        idcwait(idcaddr);
        idcaddr->idccsr &= ~IDC_ATTN;
        com = dn<<8;
-       if (func == READ)
+       if (func == F_READ)
                com |= IDC_READ;
        else
                com |= IDC_WRITE;
                com |= IDC_READ;
        else
                com |= IDC_WRITE;
index 5bf7c5e..b5af5d5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kdb.c       7.8 (Berkeley) %G%
+ *     @(#)kdb.c       7.9 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -100,7 +100,7 @@ kraopen(io)
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
-               if (krastrategy(&tio, READ) != SECTSIZ)
+               if (krastrategy(&tio, F_READ) != SECTSIZ)
                        return (ERDLAB);
                *lp = *(struct disklabel *)(lbuf + LABELOFFSET);
                if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC) {
                        return (ERDLAB);
                *lp = *(struct disklabel *)(lbuf + LABELOFFSET);
                if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC) {
@@ -164,7 +164,7 @@ krastrategy(io, func)
        mp->mscp_seq.seq_lbn = io->i_bn;
        mp->mscp_seq.seq_bytecount = io->i_cc;
        mp->mscp_seq.seq_buffer = (long)io->i_ma | KDB_PHYS;
        mp->mscp_seq.seq_lbn = io->i_bn;
        mp->mscp_seq.seq_bytecount = io->i_cc;
        mp->mscp_seq.seq_buffer = (long)io->i_ma | KDB_PHYS;
-       if (kdbcmd(func == READ ? M_OP_READ : M_OP_WRITE, io)) {
+       if (kdbcmd(func == F_READ ? M_OP_READ : M_OP_WRITE, io)) {
                printf("kra: I/O error\n");
                return (-1);
        }
                printf("kra: I/O error\n");
                return (-1);
        }
index d1265fa..48acdd1 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)mt.c        7.6 (Berkeley) %G%
+ *     @(#)mt.c        7.7 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -83,7 +83,7 @@ retry:
                mtaddr->mtas = mtaddr->mtas;
        }
 
                mtaddr->mtas = mtaddr->mtas;
        }
 
-       if (func == READ || func == WRITE) {
+       if (func == F_READ || func == F_WRITE) {
                mtaddr->mtca = 1<<2;    /* 1 record */
                mtaddr->mtbc = io->i_cc;
                mbastart(io, io->i_ctlr, func);
                mtaddr->mtca = 1<<2;    /* 1 record */
                mtaddr->mtbc = io->i_cc;
                mbastart(io, io->i_ctlr, func);
index 5f04370..0fcf366 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)rk.c        7.9 (Berkeley) %G%
+ *     @(#)rk.c        7.10 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -57,7 +57,7 @@ rkopen(io)
        tio.i_ma = lbuf;
        tio.i_cc = SECTSIZ;
        tio.i_flgs |= F_RDDATA;
        tio.i_ma = lbuf;
        tio.i_cc = SECTSIZ;
        tio.i_flgs |= F_RDDATA;
-       if (rkstrategy(&tio, READ) != SECTSIZ)
+       if (rkstrategy(&tio, F_READ) != SECTSIZ)
                return (ERDLAB);
        *lp = *(struct disklabel *)(lbuf + LABELOFFSET);
        if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC)
                return (ERDLAB);
        *lp = *(struct disklabel *)(lbuf + LABELOFFSET);
        if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC)
@@ -118,7 +118,7 @@ retry:
        rkaddr->rkba = ubinfo;
        rkaddr->rkwc = -(io->i_cc >> 1);
        com = RK_CDT|((ubinfo>>8)&0x300)|RK_GO;
        rkaddr->rkba = ubinfo;
        rkaddr->rkwc = -(io->i_cc >> 1);
        com = RK_CDT|((ubinfo>>8)&0x300)|RK_GO;
-       if (func == READ)
+       if (func == F_READ)
                com |= RK_READ;
        else
                com |= RK_WRITE;
                com |= RK_READ;
        else
                com |= RK_WRITE;
index 2e53de0..0266657 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)rl.c        7.8 (Berkeley) %G%
+ *     @(#)rl.c        7.9 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -146,7 +146,7 @@ noseek:
 
        com = (st->rl_dn << 8) | ((ubaaddr>>12)&RL_BAE);
 
 
        com = (st->rl_dn << 8) | ((ubaaddr>>12)&RL_BAE);
 
-       if (func == READ)
+       if (func == F_READ)
                com |= RL_READ;
        else
                com |= RL_WRITE;
                com |= RL_READ;
        else
                com |= RL_WRITE;
index 1b8c43e..a02c674 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)tm.c        7.7 (Berkeley) %G%
+ *     @(#)tm.c        7.8 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -63,9 +63,9 @@ retry:
        tmaddr->tmbc = -io->i_cc;
        tmaddr->tmba = info;
        com = (io->i_unit<<8) | TM_GO;
        tmaddr->tmbc = -io->i_cc;
        tmaddr->tmba = info;
        com = (io->i_unit<<8) | TM_GO;
-       if (func == READ)
+       if (func == F_READ)
                tmaddr->tmcs = com | TM_RCOM;
                tmaddr->tmcs = com | TM_RCOM;
-       else if (func == WRITE)
+       else if (func == F_WRITE)
                tmaddr->tmcs = com | TM_WCOM;
        else if (func == TM_SREV) {
                tmaddr->tmbc = -1;
                tmaddr->tmcs = com | TM_WCOM;
        else if (func == TM_SREV) {
                tmaddr->tmbc = -1;
index 13545ff..941ba35 100644 (file)
@@ -1,5 +1,5 @@
 
 
-/*     @(#)tmscp.c     7.6 (Berkeley) %G% */
+/*     @(#)tmscp.c     7.7 (Berkeley) %G% */
 
 /****************************************************************
  *                                                              *
 
 /****************************************************************
  *                                                              *
@@ -260,7 +260,7 @@ tmscpstrategy(io, func)
        mp->mscp_unit = io->i_unit&03;
        mp->mscp_bytecnt = io->i_cc;
        mp->mscp_buffer = (ubinfo & 0x3fffff) | (((ubinfo>>28)&0xf)<<24);
        mp->mscp_unit = io->i_unit&03;
        mp->mscp_bytecnt = io->i_cc;
        mp->mscp_buffer = (ubinfo & 0x3fffff) | (((ubinfo>>28)&0xf)<<24);
-       if ((mp = tmscpcmd(func == READ ? M_OP_READ : M_OP_WRITE, 0)) == 0) {
+       if ((mp = tmscpcmd(func == F_READ ? M_OP_READ : M_OP_WRITE, 0)) == 0) {
                ubafree(io, ubinfo);
                printf("tms: I/O error\n");
                return(-1);
                ubafree(io, ubinfo);
                printf("tms: I/O error\n");
                return(-1);
index 1859f74..cd7b6cb 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ts.c        7.7 (Berkeley) %G%
+ *     @(#)ts.c        7.8 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -110,9 +110,9 @@ retry:
                ts.ts_cmd.c_size = io->i_cc;
                ts.ts_cmd.c_loba = info;
                ts.ts_cmd.c_hiba = (info>>16)&3;
                ts.ts_cmd.c_size = io->i_cc;
                ts.ts_cmd.c_loba = info;
                ts.ts_cmd.c_hiba = (info>>16)&3;
-               if (func == READ)
+               if (func == F_READ)
                        func = TS_RCOM;
                        func = TS_RCOM;
-               else if (func == WRITE)
+               else if (func == F_WRITE)
                        func = TS_WCOM;
        }
        ts.ts_cmd.c_cmd = TS_ACK|TS_CVC|func;
                        func = TS_WCOM;
        }
        ts.ts_cmd.c_cmd = TS_ACK|TS_CVC|func;
index 7f37816..5191ce1 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)uda.c       7.11 (Berkeley) %G%
+ *     @(#)uda.c       7.12 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -110,7 +110,7 @@ raopen(io)
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
-               if (rastrategy(&tio, READ) != SECTSIZ)
+               if (rastrategy(&tio, F_READ) != SECTSIZ)
                        return (ERDLAB);
                *lp = *(struct disklabel *)(lbuf + LABELOFFSET);
                if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC) {
                        return (ERDLAB);
                *lp = *(struct disklabel *)(lbuf + LABELOFFSET);
                if (lp->d_magic != DISKMAGIC || lp->d_magic2 != DISKMAGIC) {
@@ -177,7 +177,7 @@ rastrategy(io, func)
        mp->mscp_seq.seq_lbn = io->i_bn;
        mp->mscp_seq.seq_bytecount = io->i_cc;
        mp->mscp_seq.seq_buffer = UBAI_ADDR(ubinfo) | (UBAI_BDP(ubinfo) << 24);
        mp->mscp_seq.seq_lbn = io->i_bn;
        mp->mscp_seq.seq_bytecount = io->i_cc;
        mp->mscp_seq.seq_buffer = UBAI_ADDR(ubinfo) | (UBAI_BDP(ubinfo) << 24);
-       if (udcmd(func == READ ? M_OP_READ : M_OP_WRITE, io)) {
+       if (udcmd(func == F_READ ? M_OP_READ : M_OP_WRITE, io)) {
                printf("ra: I/O error\n");
                ubafree(io, ubinfo);
                return (-1);
                printf("ra: I/O error\n");
                ubafree(io, ubinfo);
                return (-1);
index 0ff5f10..8f3b31a 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)up.c        7.10 (Berkeley) %G%
+ *     @(#)up.c        7.11 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -99,7 +99,7 @@ upopen(io)
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
                tio.i_ma = lbuf;
                tio.i_cc = SECTSIZ;
                tio.i_flgs |= F_RDDATA;
-               if (upstrategy(&tio, READ) != SECTSIZ)
+               if (upstrategy(&tio, F_READ) != SECTSIZ)
                        error = ERDLAB;
                dlp = (struct disklabel *)(lbuf + LABELOFFSET);
                if (error == 0 && (dlp->d_magic != DISKMAGIC ||
                        error = ERDLAB;
                dlp = (struct disklabel *)(lbuf + LABELOFFSET);
                if (error == 0 && (dlp->d_magic != DISKMAGIC ||
@@ -120,7 +120,7 @@ upopen(io)
                tio.i_cc = sizeof(struct dkbad);
                tio.i_flgs |= F_RDDATA;
                for (i = 0; i < 5; i++) {
                tio.i_cc = sizeof(struct dkbad);
                tio.i_flgs |= F_RDDATA;
                for (i = 0; i < 5; i++) {
-                       if (upstrategy(&tio, READ) == sizeof(struct dkbad))
+                       if (upstrategy(&tio, F_READ) == sizeof(struct dkbad))
                                break;
                        tio.i_bn += 2;
                }
                                break;
                        tio.i_bn += 2;
                }
@@ -297,7 +297,7 @@ hard:
                upaddr->upcs1 = UP_SEEK|UP_GO;
                upwaitdry(upaddr);
        }
                upaddr->upcs1 = UP_SEEK|UP_GO;
                upwaitdry(upaddr);
        }
-       if (io->i_errcnt >= 16 && (func & READ)) {
+       if (io->i_errcnt >= 16 && (func & F_READ)) {
                upaddr->upof = up_offset[io->i_errcnt & 017] | UPOF_FMT22;
                upaddr->upcs1 = UP_OFFSET|UP_GO;
                upwaitdry(upaddr);
                upaddr->upof = up_offset[io->i_errcnt & 017] | UPOF_FMT22;
                upaddr->upcs1 = UP_OFFSET|UP_GO;
                upwaitdry(upaddr);
index fc55c41..c8f56be 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ut.c        7.7 (Berkeley) %G%
+ *     @(#)ut.c        7.8 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -72,10 +72,10 @@ retry:
        info = ubasetup(io, 1);
        addr->utwc = -((io->i_cc+1) >> 1);
        addr->utfc = -io->i_cc;
        info = ubasetup(io, 1);
        addr->utwc = -((io->i_cc+1) >> 1);
        addr->utfc = -io->i_cc;
-       if (func == READ) {
+       if (func == F_READ) {
                addr->utba = info;
                addr->utcs1 = UT_RCOM | ((info>>8) & 0x30) | UT_GO;
                addr->utba = info;
                addr->utcs1 = UT_RCOM | ((info>>8) & 0x30) | UT_GO;
-       } else if (func == WRITE) {
+       } else if (func == F_WRITE) {
                addr->utba = info;
                addr->utcs1 = UT_WCOM | ((info>>8) & 0x30) | UT_GO;
        } else if (func == UT_SREV) {
                addr->utba = info;
                addr->utcs1 = UT_WCOM | ((info>>8) & 0x30) | UT_GO;
        } else if (func == UT_SREV) {
@@ -103,7 +103,7 @@ retry:
                addr->utcs1 = UT_CLEAR | UT_GO;
                utstrategy(io, UT_SREV);
                utquiet(addr);
                addr->utcs1 = UT_CLEAR | UT_GO;
                utstrategy(io, UT_SREV);
                utquiet(addr);
-               if (func == WRITE) {
+               if (func == F_WRITE) {
                        addr->utcs1 = UT_ERASE | UT_GO;
                        UTWAIT(addr);
                }
                        addr->utcs1 = UT_ERASE | UT_GO;
                        UTWAIT(addr);
                }
@@ -112,7 +112,7 @@ retry:
        if (errcnt)
                printf("ut: recovered by retry\n");
 done:
        if (errcnt)
                printf("ut: recovered by retry\n");
 done:
-       if (func == READ) {
+       if (func == F_READ) {
                resid = 0;
                if (io->i_cc > MASKREG(addr->utfc))
                        resid = io->i_cc - MASKREG(addr->utfc);
                resid = 0;
                if (io->i_cc > MASKREG(addr->utfc))
                        resid = io->i_cc - MASKREG(addr->utfc);