From 4eb73cdafffefcf65741a80033ac3d9815e54c5b Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 1 Dec 1996 16:34:41 +0000 Subject: [PATCH] Removed all references to b_cylinder (aka b_cylin). It was evil and hasn't been used for a year or two since disksort() started sorting on b_pblkno. --- sys/amd64/amd64/machdep.c | 6 ++---- sys/i386/i386/machdep.c | 6 ++---- sys/i386/isa/wd.c | 4 ++-- sys/kern/subr_disklabel.c | 10 +--------- sys/kern/subr_diskslice.c | 9 +-------- sys/pc98/i386/machdep.c | 6 ++---- sys/pc98/pc98/machdep.c | 6 ++---- sys/pc98/pc98/sbic55.c.new | 1 - sys/pc98/pc98/wd.c | 4 ++-- sys/scsi/od.c | 4 ++-- sys/scsi/sd.c | 4 ++-- sys/ufs/ufs/ufs_disksubr.c | 10 +--------- 12 files changed, 19 insertions(+), 51 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index c5d06450d7c..6d58566f641 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.214 1996/11/29 13:19:26 bde Exp $ + * $Id: machdep.c,v 1.215 1996/12/01 15:46:40 dyson Exp $ */ #include "npx.h" @@ -1478,7 +1478,7 @@ Debugger(const char *msg) #endif /* no DDB */ #include -#define b_cylin b_resid + /* * Determine the size of the transfer, and make sure it is * within the boundaries of the partition. Adjust transfer @@ -1528,9 +1528,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel) bp->b_bcount = sz << DEV_BSHIFT; } - /* calculate cylinder for disksort to order transfers with */ bp->b_pblkno = bp->b_blkno + p->p_offset; - bp->b_cylin = bp->b_pblkno / lp->d_secpercyl; return(1); bad: diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index c5d06450d7c..6d58566f641 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.214 1996/11/29 13:19:26 bde Exp $ + * $Id: machdep.c,v 1.215 1996/12/01 15:46:40 dyson Exp $ */ #include "npx.h" @@ -1478,7 +1478,7 @@ Debugger(const char *msg) #endif /* no DDB */ #include -#define b_cylin b_resid + /* * Determine the size of the transfer, and make sure it is * within the boundaries of the partition. Adjust transfer @@ -1528,9 +1528,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel) bp->b_bcount = sz << DEV_BSHIFT; } - /* calculate cylinder for disksort to order transfers with */ bp->b_pblkno = bp->b_blkno + p->p_offset; - bp->b_cylin = bp->b_pblkno / lp->d_secpercyl; return(1); bad: diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index ee43d9b25e1..a12ae44757a 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.119 1996/10/17 21:18:42 phk Exp $ + * $Id: wd.c,v 1.120 1996/11/11 15:57:40 bde Exp $ */ /* TODO: @@ -501,7 +501,7 @@ wdstrategy(register struct buf *bp) } /* - * Do bounds checking, adjust transfer, set b_cylin and b_pbklno. + * Do bounds checking, adjust transfer, and set b_pblkno. */ if (dscheck(bp, du->dk_slices) <= 0) goto done; diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c index fc1e24e6721..6221df0a985 100644 --- a/sys/kern/subr_disklabel.c +++ b/sys/kern/subr_disklabel.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 - * $Id: ufs_disksubr.c,v 1.26 1996/09/20 17:39:44 bde Exp $ + * $Id: ufs_disksubr.c,v 1.27 1996/12/01 11:25:10 sos Exp $ */ #include @@ -62,13 +62,6 @@ * allocated. */ -/* - * For portability with historic industry practice, the - * cylinder number has to be maintained in the `b_resid' - * field. - */ -#define b_cylinder b_resid - void tqdisksort(ap, bp) struct buf_queue_head *ap; @@ -186,7 +179,6 @@ readdisklabel(dev, strat, lp) bp->b_bcount = lp->d_secsize; bp->b_flags &= ~B_INVAL; bp->b_flags |= B_BUSY | B_READ; - bp->b_cylinder = LABELSECTOR / lp->d_secpercyl; (*strat)(bp); if (biowait(bp)) msg = "I/O error"; diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index 644eb64ca97..73f738381ef 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -43,7 +43,7 @@ * from: wd.c,v 1.55 1994/10/22 01:57:12 phk Exp $ * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ - * $Id: subr_diskslice.c,v 1.30 1996/10/29 13:15:30 bde Exp $ + * $Id: subr_diskslice.c,v 1.31 1996/12/01 11:25:00 sos Exp $ */ #include @@ -65,8 +65,6 @@ #include -#define b_cylinder b_resid - #define TRACE(str) do { if (ds_debug) printf str; } while (0) typedef u_char bool_t; @@ -185,12 +183,7 @@ if (labelsect != 0) Debugger("labelsect != 0 in dscheck()"); bp->b_bcount = sz << DEV_BSHIFT; } - /* calculate cylinder for disksort to order transfers with */ bp->b_pblkno = blkno + sp->ds_offset; - if (lp == NULL) - bp->b_cylinder = 0; /* XXX always 0 would be better */ - else - bp->b_cylinder = bp->b_pblkno / lp->d_secpercyl; /* * Snoop on label accesses if the slice offset is nonzero. Fudge diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 23e1d67dcd6..90f493fa50e 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.12 1996/11/02 10:38:57 asami Exp $ + * $Id: machdep.c,v 1.13 1996/11/13 02:00:17 asami Exp $ */ #include "npx.h" @@ -1507,7 +1507,7 @@ Debugger(const char *msg) #endif /* no DDB */ #include -#define b_cylin b_resid + /* * Determine the size of the transfer, and make sure it is * within the boundaries of the partition. Adjust transfer @@ -1557,9 +1557,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel) bp->b_bcount = sz << DEV_BSHIFT; } - /* calculate cylinder for disksort to order transfers with */ bp->b_pblkno = bp->b_blkno + p->p_offset; - bp->b_cylin = bp->b_pblkno / lp->d_secpercyl; return(1); bad: diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 23e1d67dcd6..90f493fa50e 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.12 1996/11/02 10:38:57 asami Exp $ + * $Id: machdep.c,v 1.13 1996/11/13 02:00:17 asami Exp $ */ #include "npx.h" @@ -1507,7 +1507,7 @@ Debugger(const char *msg) #endif /* no DDB */ #include -#define b_cylin b_resid + /* * Determine the size of the transfer, and make sure it is * within the boundaries of the partition. Adjust transfer @@ -1557,9 +1557,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel) bp->b_bcount = sz << DEV_BSHIFT; } - /* calculate cylinder for disksort to order transfers with */ bp->b_pblkno = bp->b_blkno + p->p_offset; - bp->b_cylin = bp->b_pblkno / lp->d_secpercyl; return(1); bad: diff --git a/sys/pc98/pc98/sbic55.c.new b/sys/pc98/pc98/sbic55.c.new index 349bfd6f0d8..5dc90911bf1 100644 --- a/sys/pc98/pc98/sbic55.c.new +++ b/sys/pc98/pc98/sbic55.c.new @@ -90,7 +90,6 @@ extern short dmapageport[]; #define SBIC_INIT_WAIT 50000 /* wait per step (both) during init */ #define SBIC_RESET_TIMEOUT 2000 -#define b_cylin b_resid #define SBIC_WAIT(sbic, until, timeo) sbicwait(sbic, until, timeo, __LINE__) #define SBIC_ENABLE_INT(iobase) { \ u_char tmp; \ diff --git a/sys/pc98/pc98/wd.c b/sys/pc98/pc98/wd.c index b023177699a..2f6da0ef464 100644 --- a/sys/pc98/pc98/wd.c +++ b/sys/pc98/pc98/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.9 1996/10/23 07:25:35 asami Exp $ + * $Id: wd.c,v 1.10 1996/11/02 10:40:07 asami Exp $ */ /* TODO: @@ -599,7 +599,7 @@ wdstrategy(register struct buf *bp) #endif /* - * Do bounds checking, adjust transfer, set b_cylin and b_pbklno. + * Do bounds checking, adjust transfer, and set b_pblkno. */ if (dscheck(bp, du->dk_slices) <= 0) goto done; diff --git a/sys/scsi/od.c b/sys/scsi/od.c index f13ca42adc9..50d012d41c1 100644 --- a/sys/scsi/od.c +++ b/sys/scsi/od.c @@ -28,7 +28,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: od.c,v 1.23 1996/11/06 17:31:14 joerg Exp $ + * $Id: od.c,v 1.24 1996/12/01 11:25:17 sos Exp $ */ /* @@ -487,7 +487,7 @@ od_strategy(struct buf *bp, struct scsi_link *sc_link) } /* - * Do bounds checking, adjust transfer, set b_cylin and b_pbklno. + * Do bounds checking, adjust transfer, and set b_pblkno. */ { int status; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 29f15532eca..ba62547b3d1 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.95 1996/09/14 04:31:09 bde Exp $ + * $Id: sd.c,v 1.96 1996/12/01 11:25:18 sos Exp $ */ #include "opt_bounce.h" @@ -435,7 +435,7 @@ sd_strategy(struct buf *bp, struct scsi_link *sc_link) goto bad; } /* - * Do bounds checking, adjust transfer, set b_cylin and b_pbklno. + * Do bounds checking, adjust transfer, and set b_pblkno. */ if (dscheck(bp, sd->dk_slices) <= 0) goto done; /* XXX check b_resid */ diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c index fc1e24e6721..6221df0a985 100644 --- a/sys/ufs/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs/ufs_disksubr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 - * $Id: ufs_disksubr.c,v 1.26 1996/09/20 17:39:44 bde Exp $ + * $Id: ufs_disksubr.c,v 1.27 1996/12/01 11:25:10 sos Exp $ */ #include @@ -62,13 +62,6 @@ * allocated. */ -/* - * For portability with historic industry practice, the - * cylinder number has to be maintained in the `b_resid' - * field. - */ -#define b_cylinder b_resid - void tqdisksort(ap, bp) struct buf_queue_head *ap; @@ -186,7 +179,6 @@ readdisklabel(dev, strat, lp) bp->b_bcount = lp->d_secsize; bp->b_flags &= ~B_INVAL; bp->b_flags |= B_BUSY | B_READ; - bp->b_cylinder = LABELSECTOR / lp->d_secpercyl; (*strat)(bp); if (biowait(bp)) msg = "I/O error";