From 85a219d2017d0e1ffc28eb51592f30df7f2a699e Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Thu, 9 Sep 1999 19:08:44 +0000 Subject: Changes to centralise the default blocksize behaviour. More likely to follow. Submitted by: phk@freebsd.org --- sys/dev/ccd/ccd.c | 4 ---- sys/dev/fdc/fdc.c | 3 --- sys/dev/mcd/mcd.c | 4 ++-- sys/dev/scd/scd.c | 4 ++-- sys/dev/vinum/vinum.c | 3 --- sys/dev/vn/vn.c | 5 +---- 6 files changed, 5 insertions(+), 18 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index 7badacb7d7c00..a889ca38ca1c5 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -633,10 +633,6 @@ ccdopen(dev, flags, fmt, p) part = ccdpart(dev); pmask = (1 << part); - dev->si_bsize_phys = DEV_BSIZE; - dev->si_bsize_best = BLKDEV_IOSIZE; - dev->si_bsize_max = MAXBSIZE; - /* * If we're initialized, check to see if there are any other * open partitions. If not, then it's safe to update diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index ee74217232e41..7e6b0b3415fed 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -1279,9 +1279,6 @@ Fdopen(dev_t dev, int flags, int mode, struct proc *p) fd_p fd; fdc_p fdc; - dev->si_bsize_phys = DEV_BSIZE; - dev->si_bsize_best = BLKDEV_IOSIZE; - dev->si_bsize_max = MAXBSIZE; /* check bounds */ if ((fd = devclass_get_softc(fd_devclass, fdu)) == 0) return (ENXIO); diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c index 37bd50842e566..19f35e65660e9 100644 --- a/sys/dev/mcd/mcd.c +++ b/sys/dev/mcd/mcd.c @@ -296,8 +296,6 @@ int mcdopen(dev_t dev, int flags, int fmt, struct proc *p) if (!(cd->flags & MCDVALID) && cd->openflags) return ENXIO; - dev->si_bsize_phys = 2048; - dev->si_bsize_max = MAXBSIZE; if (mcd_getstat(unit,1) == -1) return EIO; @@ -352,6 +350,8 @@ int mcdopen(dev_t dev, int flags, int fmt, struct proc *p) MCD_TRACE("open: partition=%d, disksize = %ld, blksize=%d\n", part, cd->disksize, cd->blksize); + dev->si_bsize_phys = cd->blksize; + if (part == RAW_PART || (part < cd->dlabel.d_npartitions && cd->dlabel.d_partitions[part].p_fstype != FS_UNUSED)) { diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c index 1742fdd47819a..719c86b30d91b 100644 --- a/sys/dev/scd/scd.c +++ b/sys/dev/scd/scd.c @@ -258,8 +258,6 @@ scdopen(dev_t dev, int flags, int fmt, struct proc *p) XDEBUG(1,("scd%d: DEBUG: status = 0x%x\n", unit, inb(cd->iobase+IREG_STATUS))); - dev->si_bsize_phys = 2048; - dev->si_bsize_max = MAXBSIZE; if ((rc = spin_up(unit)) != 0) { print_error(unit, rc); return EIO; @@ -281,6 +279,8 @@ scdopen(dev_t dev, int flags, int fmt, struct proc *p) } } + dev->si_bsize_phys = cd->blksize; + cd->openflag = 1; cd->flags |= SCDVALID; diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c index 2482185d7aba5..c70b1c7e6c2eb 100644 --- a/sys/dev/vinum/vinum.c +++ b/sys/dev/vinum/vinum.c @@ -268,9 +268,6 @@ vinumopen(dev_t dev, int devminor; /* minor number */ devminor = minor(dev); - dev->si_bsize_phys = DEV_BSIZE; - dev->si_bsize_best = VINUM_BSIZE_BEST; /* kludge until we track drive block sizes */ - dev->si_bsize_max = MAXBSIZE; error = 0; /* First, decide what we're looking at */ switch (DEVTYPE(dev)) { diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index f51efca8ed757..199c8046d4603 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -510,10 +510,7 @@ vniocattach_file(vn, vio, dev, flag, p) (void) vn_close(nd.ni_vp, flags, p->p_ucred, p); return(error); } - if (dev->si_bsize_phys < vn->sc_secsize) - dev->si_bsize_phys = vn->sc_secsize; - if (dev->si_bsize_best < vn->sc_secsize) - dev->si_bsize_best = vn->sc_secsize; + dev->si_bsize_phys = vn->sc_secsize; vn->sc_flags |= VNF_INITED; if (flags == FREAD) vn->sc_flags |= VNF_READONLY; -- cgit v1.3