aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/specfs
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-09-22 19:56:14 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-09-22 19:56:14 +0000
commitc428d4c0488ab371d07b3425f2f04cb9a3a7d294 (patch)
treeea26d4fc6d720298699e3b33c18868559387b610 /sys/miscfs/specfs
parentefee742ecc6cb3a713ee15fd85fb1aab3eb4c1aa (diff)
downloadsrc-c428d4c0488ab371d07b3425f2f04cb9a3a7d294.tar.gz
src-c428d4c0488ab371d07b3425f2f04cb9a3a7d294.zip
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.
Notes
Notes: svn path=/head/; revision=51558
Diffstat (limited to 'sys/miscfs/specfs')
-rw-r--r--sys/miscfs/specfs/spec_vnops.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index 0f4a334f8258..e8a216319b29 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/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);
}