diff options
author | julian <julian@FreeBSD.org> | 1999-09-03 08:26:46 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-09-03 08:26:46 +0000 |
commit | a5d766bc99873104e223b81fcc566bea7715e8d0 (patch) | |
tree | 5137416b5817a5d1700cedad215110d3382cacdd /sys/fs | |
parent | 591be2fb056226e8c9b9361bdc804ef35482ee82 (diff) | |
download | FreeBSD-src-a5d766bc99873104e223b81fcc566bea7715e8d0.zip FreeBSD-src-a5d766bc99873104e223b81fcc566bea7715e8d0.tar.gz |
Add a catchall to set default blocksize values for disk like devices.
Submitted by: phk@freebsd.org
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 1afc400..44c23ba 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -203,8 +203,7 @@ spec_open(ap) VOP_UNLOCK(vp, 0, p); error = (*dsw->d_open)(dev, ap->a_mode, S_IFCHR, p); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - return (error); - /* NOT REACHED */ + break; case VBLK: dsw = devsw(dev); if ( (dsw == NULL) || (dsw->d_open == NULL)) @@ -225,12 +224,21 @@ spec_open(ap) error = vfs_mountedon(vp); if (error) return (error); - return ((*dsw->d_open)(dev, ap->a_mode, S_IFBLK, p)); - /* NOT REACHED */ + error = (*dsw->d_open)(dev, ap->a_mode, S_IFBLK, p); + break; default: break; } - return (0); + + 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; + } + return (error); } /* |