diff options
author | phk <phk@FreeBSD.org> | 1999-09-22 19:56:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-09-22 19:56:14 +0000 |
commit | 56948f82f5dc2d74432bc167dc307d2efa804e97 (patch) | |
tree | aa1cec6687b5942804ab9aee76ca908bc41463a7 /sys/fs/specfs | |
parent | 9e9ee6a9d861a3edf3d0726e5344af5760250c3b (diff) | |
download | FreeBSD-src-56948f82f5dc2d74432bc167dc307d2efa804e97.zip FreeBSD-src-56948f82f5dc2d74432bc167dc307d2efa804e97.tar.gz |
Kill the cdevsw->d_maxio field.
d_maxio is replaced by the dev->si_iosize_max field which the driver
should be set in all calls to cdevsw->d_open if it has a better
idea than the system wide default.
The field is a generic dev_t field (ie: not disk specific) so that
tapes and other devices can use physio as well.
Diffstat (limited to 'sys/fs/specfs')
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 0f4a334..e8a2163 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -167,6 +167,10 @@ spec_open(ap) if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_NODEV)) return (ENXIO); + /* Make this field valid before any I/O in ->d_open */ + if (!dev->si_iosize_max) + dev->si_iosize_max = DFLTPHYS; + switch (vp->v_type) { case VCHR: dsw = devsw(dev); @@ -233,15 +237,13 @@ spec_open(ap) if (vn_isdisk(vp)) { if (!dev->si_bsize_phys) dev->si_bsize_phys = DEV_BSIZE; - maxio = dev->si_iosize_max; - if (!maxio) - maxio = devsw(dev)->d_maxio; /* XXX */ - if (!maxio) - maxio = DFLTPHYS; - if (maxio > MAXPHYS) - maxio = MAXPHYS; - vp->v_maxio = maxio; } + maxio = dev->si_iosize_max; + if (!maxio) + maxio = DFLTPHYS; + if (maxio > MAXPHYS) + maxio = MAXPHYS; + vp->v_maxio = maxio; return (error); } |