summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1999-09-09 19:08:44 +0000
committerjulian <julian@FreeBSD.org>1999-09-09 19:08:44 +0000
commit5c78e7345a2fd91174249db5a41aec14e57f1fb3 (patch)
treee7d99a6be8ccf0086169fae4fdd8377ccf9252be /sys/fs
parentd475da44561ed80c7ceb7e75432d70a726c7e751 (diff)
downloadFreeBSD-src-5c78e7345a2fd91174249db5a41aec14e57f1fb3.zip
FreeBSD-src-5c78e7345a2fd91174249db5a41aec14e57f1fb3.tar.gz
Changes to centralise the default blocksize behaviour.
More likely to follow. Submitted by: phk@freebsd.org
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/specfs/spec_vnops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c
index 9d85bfe..7b2d712 100644
--- a/sys/fs/specfs/spec_vnops.c
+++ b/sys/fs/specfs/spec_vnops.c
@@ -234,8 +234,6 @@ spec_open(ap)
if (vn_isdisk(vp)) {
if (!dev->si_bsize_phys)
dev->si_bsize_phys = DEV_BSIZE;
- if (dev->si_bsize_best < dev->si_bsize_phys)
- dev->si_bsize_best = BLKDEV_IOSIZE;
if (!dev->si_bsize_max)
dev->si_bsize_max = MAXBSIZE;
}
@@ -296,6 +294,10 @@ spec_read(ap)
*/
bsize = vp->v_rdev->si_bsize_best;
+ if (bsize < vp->v_rdev->si_bsize_phys)
+ bsize = vp->v_rdev->si_bsize_phys;
+ if (bsize < BLKDEV_IOSIZE)
+ bsize = BLKDEV_IOSIZE;
if ((ioctl = devsw(dev)->d_ioctl) != NULL &&
(*ioctl)(dev, DIOCGPART, (caddr_t)&dpart, FREAD, p) == 0 &&
@@ -380,6 +382,10 @@ spec_write(ap)
* be larger then the physical minimum.
*/
bsize = vp->v_rdev->si_bsize_best;
+ if (bsize < vp->v_rdev->si_bsize_phys)
+ bsize = vp->v_rdev->si_bsize_phys;
+ if (bsize < BLKDEV_IOSIZE)
+ bsize = BLKDEV_IOSIZE;
if ((*devsw(vp->v_rdev)->d_ioctl)(vp->v_rdev, DIOCGPART,
(caddr_t)&dpart, FREAD, p) == 0) {
OpenPOWER on IntegriCloud