Use b_cylinder as defined in sys/buf.h

This commit is contained in:
thorpej 2000-01-18 19:43:02 +00:00
parent 0684e6f83b
commit 8201b36ca0
5 changed files with 20 additions and 30 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.2 2000/01/11 08:22:38 nisimura Exp $ */
/* $NetBSD: disksubr.c,v 1.3 2000/01/18 19:43:02 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@ -56,8 +56,6 @@
/* XXX encoding of disk minor numbers, should be elsewhere... */
#define dkpart(dev) (minor(dev) & 7)
#define b_cylin b_resid
#if LABELSECTOR != 0
#error "Default value of LABELSECTOR no longer zero?"
#endif
@ -103,7 +101,7 @@ readdisklabel(dev, strat, lp, clp)
/* next, dig out disk label */
bp->b_dev = dev;
bp->b_blkno = LABELSECTOR;
bp->b_cylin = 0;
bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
(*strat)(bp);
@ -218,7 +216,7 @@ writedisklabel(dev, strat, lp, clp)
/* Write out the updated label. */
bp->b_dev = dev;
bp->b_blkno = LABELSECTOR;
bp->b_cylin = 0;
bp->b_cylinder = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_WRITE;
(*strat)(bp);
@ -273,7 +271,7 @@ bounds_check_with_label(bp, lp, wlabel)
}
/* calculate cylinder for disksort to order transfers with */
bp->b_cylin = (bp->b_blkno + p->p_offset) / lp->d_secpercyl;
bp->b_cylinder = (bp->b_blkno + p->p_offset) / lp->d_secpercyl;
return(1);
bad:

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.32 1999/05/01 09:26:32 scottr Exp $ */
/* $NetBSD: disksubr.c,v 1.33 2000/01/18 19:43:23 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -88,8 +88,6 @@
#include <machine/bswap.h>
#define b_cylin b_resid
#define NUM_PARTS 32
#define ROOT_PART 1
@ -278,7 +276,7 @@ read_mac_label(dev, strat, lp, osdep)
bp->b_blkno = 1; /* partition map starts at blk 1 */
bp->b_bcount = lp->d_secsize * NUM_PARTS;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = 1 / lp->d_secpercyl;
bp->b_cylinder = 1 / lp->d_secpercyl;
(*strat)(bp);
if (biowait(bp)) {
@ -367,7 +365,7 @@ read_dos_label(dev, strat, lp, osdep)
bp->b_blkno = MBR_BBSECTOR;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = MBR_BBSECTOR / lp->d_secpercyl;
bp->b_cylinder = MBR_BBSECTOR / lp->d_secpercyl;
(*strat)(bp);
/* if successful, wander through dos partition table */
@ -441,7 +439,7 @@ readdisklabel(dev, strat, lp, osdep)
bp->b_resid = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = 1 / lp->d_secpercyl;
bp->b_cylinder = 1 / lp->d_secpercyl;
(*strat)(bp);
if (biowait(bp)) {
@ -616,7 +614,7 @@ bounds_check_with_label(bp, lp, wlabel)
#endif
/* calculate cylinder for disksort to order transfers with */
bp->b_cylin = (bp->b_blkno + p->p_offset) /
bp->b_cylinder = (bp->b_blkno + p->p_offset) /
(lp->d_secsize / DEV_BSIZE) / lp->d_secpercyl;
return (1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.5 1999/09/27 17:02:44 wrstuden Exp $ */
/* $NetBSD: disksubr.c,v 1.6 2000/01/18 19:44:18 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -119,8 +119,6 @@
#include <machine/bswap.h>
#define b_cylin b_resid
#define NUM_PARTS 32
#define ROOT_PART 1
@ -311,7 +309,7 @@ read_mac_label(dev, strat, lp, osdep)
bp->b_blkno = 1; /* partition map starts at blk 1 */
bp->b_bcount = lp->d_secsize * NUM_PARTS;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = 1 / lp->d_secpercyl;
bp->b_cylinder = 1 / lp->d_secpercyl;
(*strat)(bp);
if (biowait(bp)) {
@ -400,7 +398,7 @@ read_dos_label(dev, strat, lp, osdep)
bp->b_blkno = MBR_BBSECTOR;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = MBR_BBSECTOR / lp->d_secpercyl;
bp->b_cylinder = MBR_BBSECTOR / lp->d_secpercyl;
(*strat)(bp);
/* if successful, wander through dos partition table */
@ -519,7 +517,7 @@ readdisklabel(dev, strat, lp, osdep)
bp->b_resid = 0;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = 1 / lp->d_secpercyl;
bp->b_cylinder = 1 / lp->d_secpercyl;
(*strat)(bp);
osdep->cd_start = -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.16 1999/01/31 14:06:40 scw Exp $ */
/* $NetBSD: disksubr.c,v 1.17 2000/01/18 19:45:28 thorpej Exp $ */
/*
* Copyright (c) 1995 Dale Rahn.
@ -43,8 +43,6 @@
#include <machine/autoconf.h>
#define b_cylin b_resid
#ifdef DEBUG
int disksubr_debug = 0;
#endif
@ -124,7 +122,7 @@ readdisklabel(dev, strat, lp, clp)
bp->b_blkno = 0; /* contained in block 0 */
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = 0; /* contained in block 0 */
bp->b_cylinder = 0; /* contained in block 0 */
(*strat)(bp);
if (biowait(bp)) {
@ -245,7 +243,7 @@ writedisklabel(dev, strat, lp, clp)
bp->b_blkno = 0; /* contained in block 0 */
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = 0; /* contained in block 0 */
bp->b_cylinder = 0; /* contained in block 0 */
(*strat)(bp);
if (error = biowait(bp)) {
@ -281,7 +279,7 @@ writedisklabel(dev, strat, lp, clp)
bp->b_blkno = 0; /* contained in block 0 */
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_WRITE;
bp->b_cylin = 0; /* contained in block 0 */
bp->b_cylinder = 0; /* contained in block 0 */
(*strat)(bp);
error = biowait(bp);
@ -330,7 +328,7 @@ bounds_check_with_label(bp, lp, wlabel)
}
/* calculate cylinder for disksort to order transfers with */
bp->b_cylin = (bp->b_blkno + p->p_offset) / lp->d_secpercyl;
bp->b_cylinder = (bp->b_blkno + p->p_offset) / lp->d_secpercyl;
return(1);
bad:

View File

@ -1,4 +1,4 @@
/* $NetBSD: disksubr.c,v 1.1 1999/12/09 14:53:16 tsutsui Exp $ */
/* $NetBSD: disksubr.c,v 1.2 2000/01/18 19:45:52 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@ -42,8 +42,6 @@
#include <sys/disk.h>
#include <sys/disklabel.h>
#define b_cylin b_resid
char* readdisklabel __P((dev_t dev, void (*strat) __P((struct buf *bp)),
register struct disklabel *lp,
struct cpu_disklabel *osdep));
@ -79,7 +77,7 @@ readdisklabel(dev, strat, lp, osdep)
bp->b_blkno = LABELSECTOR;
bp->b_bcount = lp->d_secsize;
bp->b_flags = B_BUSY | B_READ;
bp->b_cylin = LABELSECTOR / lp->d_secpercyl;
bp->b_cylinder = LABELSECTOR / lp->d_secpercyl;
(*strat)(bp);
if (biowait(bp)) {
msg = "I/O error";