SCCS-vsn: sys/vax/mba/ht.c 4.23
SCCS-vsn: sys/vax/mba/mt.c 4.4
-/* ht.c 4.22 82/05/12 */
+/* ht.c 4.23 82/07/13 */
#include "tu.h"
#if NHT > 0
#include "tu.h"
#if NHT > 0
return (MBU_NEXT);
}
if (bp != &chtbuf[HTUNIT(bp->b_dev)]) {
return (MBU_NEXT);
}
if (bp != &chtbuf[HTUNIT(bp->b_dev)]) {
- if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) {
+ if (bdbtofsb(bp->b_blkno) > sc->sc_nxrec) {
bp->b_flags |= B_ERROR;
bp->b_error = ENXIO;
return (MBU_NEXT);
}
bp->b_flags |= B_ERROR;
bp->b_error = ENXIO;
return (MBU_NEXT);
}
- if (dbtofsb(bp->b_blkno) == sc->sc_nxrec &&
+ if (bdbtofsb(bp->b_blkno) == sc->sc_nxrec &&
bp->b_flags&B_READ) {
bp->b_resid = bp->b_bcount;
clrbuf(bp);
return (MBU_NEXT);
}
if ((bp->b_flags&B_READ)==0)
bp->b_flags&B_READ) {
bp->b_resid = bp->b_bcount;
clrbuf(bp);
return (MBU_NEXT);
}
if ((bp->b_flags&B_READ)==0)
- sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1;
+ sc->sc_nxrec = bdbtofsb(bp->b_blkno) + 1;
} else {
if (bp->b_command == HT_SENSE)
return (MBU_NEXT);
} else {
if (bp->b_command == HT_SENSE)
return (MBU_NEXT);
htaddr->htcs1 = bp->b_command|HT_GO;
return (MBU_STARTED);
}
htaddr->htcs1 = bp->b_command|HT_GO;
return (MBU_STARTED);
}
- if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) {
+ if ((blkno = sc->sc_blkno) == bdbtofsb(bp->b_blkno)) {
htaddr->htfc = -bp->b_bcount;
if ((bp->b_flags&B_READ) == 0) {
if (mi->mi_tab.b_errcnt) {
htaddr->htfc = -bp->b_bcount;
if ((bp->b_flags&B_READ) == 0) {
if (mi->mi_tab.b_errcnt) {
- if (blkno < dbtofsb(bp->b_blkno)) {
- htaddr->htfc = blkno - dbtofsb(bp->b_blkno);
+ if (blkno < bdbtofsb(bp->b_blkno)) {
+ htaddr->htfc = blkno - bdbtofsb(bp->b_blkno);
htaddr->htcs1 = HT_SFORW|HT_GO;
} else {
htaddr->htcs1 = HT_SFORW|HT_GO;
} else {
- htaddr->htfc = dbtofsb(bp->b_blkno) - blkno;
+ htaddr->htfc = bdbtofsb(bp->b_blkno) - blkno;
htaddr->htcs1 = HT_SREV|HT_GO;
}
return (MBU_STARTED);
htaddr->htcs1 = HT_SREV|HT_GO;
}
return (MBU_STARTED);
if (bp->b_flags & B_READ)
if (ds&HTDS_TM) { /* must be a read, right? */
bp->b_resid = bp->b_bcount;
if (bp->b_flags & B_READ)
if (ds&HTDS_TM) { /* must be a read, right? */
bp->b_resid = bp->b_bcount;
- sc->sc_nxrec = dbtofsb(bp->b_blkno);
+ sc->sc_nxrec = bdbtofsb(bp->b_blkno);
} else if(bp->b_bcount > MASKREG(htaddr->htfc))
bp->b_resid = bp->b_bcount - MASKREG(htaddr->htfc);
return (MBD_DONE);
} else if(bp->b_bcount > MASKREG(htaddr->htfc))
bp->b_resid = bp->b_bcount - MASKREG(htaddr->htfc);
return (MBD_DONE);
return (MBN_DONE);
}
if (ds & HTDS_TM)
return (MBN_DONE);
}
if (ds & HTDS_TM)
- if (sc->sc_blkno > dbtofsb(bp->b_blkno)) {
- sc->sc_nxrec = dbtofsb(bp->b_blkno) - fc;
+ if (sc->sc_blkno > bdbtofsb(bp->b_blkno)) {
+ sc->sc_nxrec = bdbtofsb(bp->b_blkno) - fc;
sc->sc_blkno = sc->sc_nxrec;
} else {
sc->sc_blkno = sc->sc_nxrec;
} else {
- sc->sc_blkno = dbtofsb(bp->b_blkno) + fc;
+ sc->sc_blkno = bdbtofsb(bp->b_blkno) + fc;
sc->sc_nxrec = sc->sc_blkno - 1;
}
else
sc->sc_nxrec = sc->sc_blkno - 1;
}
else
- sc->sc_blkno = dbtofsb(bp->b_blkno);
+ sc->sc_blkno = bdbtofsb(bp->b_blkno);
}
a = u.u_offset >> 9;
sc = &tu_softc[TUUNIT(dev)];
}
a = u.u_offset >> 9;
sc = &tu_softc[TUUNIT(dev)];
- sc->sc_blkno = dbtofsb(a);
- sc->sc_nxrec = dbtofsb(a)+1;
+ sc->sc_blkno = bdbtofsb(a);
+ sc->sc_nxrec = bdbtofsb(a)+1;
#include "mu.h"
#if NMT > 0
#include "mu.h"
#if NMT > 0
return (MBU_NEXT);
}
if (bp != &cmtbuf[MTUNIT(bp->b_dev)]) {
return (MBU_NEXT);
}
if (bp != &cmtbuf[MTUNIT(bp->b_dev)]) {
- if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) {
+ if (bdbtofsb(bp->b_blkno) > sc->sc_nxrec) {
bp->b_flags |= B_ERROR;
bp->b_error = ENXIO;
return (MBU_NEXT);
}
bp->b_flags |= B_ERROR;
bp->b_error = ENXIO;
return (MBU_NEXT);
}
- if (dbtofsb(bp->b_blkno) == sc->sc_nxrec &&
+ if (bdbtofsb(bp->b_blkno) == sc->sc_nxrec &&
bp->b_flags&B_READ) {
bp->b_resid = bp->b_bcount;
clrbuf(bp);
return (MBU_NEXT);
}
if ((bp->b_flags&B_READ)==0)
bp->b_flags&B_READ) {
bp->b_resid = bp->b_bcount;
clrbuf(bp);
return (MBU_NEXT);
}
if ((bp->b_flags&B_READ)==0)
- sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1;
+ sc->sc_nxrec = bdbtofsb(bp->b_blkno) + 1;
} else {
mtaddr->mtncs[MUUNIT(bp->b_dev)] =
(bp->b_repcnt<<8)|bp->b_command|MT_GO;
return (MBU_STARTED);
}
} else {
mtaddr->mtncs[MUUNIT(bp->b_dev)] =
(bp->b_repcnt<<8)|bp->b_command|MT_GO;
return (MBU_STARTED);
}
- if ((blkno = sc->sc_blkno) == dbtofsb(bp->b_blkno)) {
+ if ((blkno = sc->sc_blkno) == bdbtofsb(bp->b_blkno)) {
if (mi->mi_tab.b_errcnt == 2) {
mtaddr->mtca = MUUNIT(bp->b_dev);
} else {
if (mi->mi_tab.b_errcnt == 2) {
mtaddr->mtca = MUUNIT(bp->b_dev);
} else {
- if (blkno < dbtofsb(bp->b_blkno))
+ if (blkno < bdbtofsb(bp->b_blkno))
mtaddr->mtncs[MUUNIT(bp->b_dev)] =
mtaddr->mtncs[MUUNIT(bp->b_dev)] =
- (min((unsigned)(dbtofsb(bp->b_blkno) - blkno), 0377) << 8) |
+ (min((unsigned)(bdbtofsb(bp->b_blkno) - blkno), 0377) << 8) |
MT_SFORW|MT_GO;
else
mtaddr->mtncs[MUUNIT(bp->b_dev)] =
MT_SFORW|MT_GO;
else
mtaddr->mtncs[MUUNIT(bp->b_dev)] =
- (min((unsigned)(blkno - dbtofsb(bp->b_blkno)), 0377) << 8) |
+ (min((unsigned)(blkno - bdbtofsb(bp->b_blkno)), 0377) << 8) |
MT_SREV|MT_GO;
return (MBU_STARTED);
}
MT_SREV|MT_GO;
return (MBU_STARTED);
}
sc->sc_blkno++;
err:
bp->b_resid = bp->b_bcount;
sc->sc_blkno++;
err:
bp->b_resid = bp->b_bcount;
- sc->sc_nxrec = dbtofsb(bp->b_blkno);
+ sc->sc_nxrec = bdbtofsb(bp->b_blkno);
break;
case MTER_SHRTREC:
break;
case MTER_SHRTREC:
return (MBN_DONE);
}
/* this is UGLY! (but is it correct?) */
return (MBN_DONE);
}
/* this is UGLY! (but is it correct?) */
- if ((fc = dbtofsb(bp->b_blkno) - sc->sc_blkno) < 0)
+ if ((fc = bdbtofsb(bp->b_blkno) - sc->sc_blkno) < 0)
sc->sc_blkno -= MIN(0377, -fc);
else
sc->sc_blkno += MIN(0377, fc);
sc->sc_blkno -= MIN(0377, -fc);
else
sc->sc_blkno += MIN(0377, fc);
case MTER_TM:
case MTER_EOT:
case MTER_LEOT:
case MTER_TM:
case MTER_EOT:
case MTER_LEOT:
- if (sc->sc_blkno > dbtofsb(bp->b_blkno)) {
- sc->sc_nxrec = dbtofsb(bp->b_blkno) + fc;
+ if (sc->sc_blkno > bdbtofsb(bp->b_blkno)) {
+ sc->sc_nxrec = bdbtofsb(bp->b_blkno) + fc;
sc->sc_blkno = sc->sc_nxrec;
} else {
sc->sc_blkno = sc->sc_nxrec;
} else {
- sc->sc_blkno = dbtofsb(bp->b_blkno) - fc;
+ sc->sc_blkno = bdbtofsb(bp->b_blkno) - fc;
sc->sc_nxrec = sc->sc_blkno - 1;
}
return (MBN_RETRY);
sc->sc_nxrec = sc->sc_blkno - 1;
}
return (MBN_RETRY);
}
a = u.u_offset >> 9;
sc = &mu_softc[MUUNIT(dev)];
}
a = u.u_offset >> 9;
sc = &mu_softc[MUUNIT(dev)];
- sc->sc_blkno = dbtofsb(a);
- sc->sc_nxrec = dbtofsb(a)+1;
+ sc->sc_blkno = bdbtofsb(a);
+ sc->sc_nxrec = bdbtofsb(a)+1;