diff options
author | phk <phk@FreeBSD.org> | 1999-09-20 19:57:28 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-09-20 19:57:28 +0000 |
commit | 3ea30afc2df519befce9b302ed4959d17a6392e6 (patch) | |
tree | f5b84884151162e62383cc75887209758a02a78c /sys/gnu | |
parent | c0818069f7d5c0aa756e24c5d4605e5c1da60edc (diff) | |
download | FreeBSD-src-3ea30afc2df519befce9b302ed4959d17a6392e6.zip FreeBSD-src-3ea30afc2df519befce9b302ed4959d17a6392e6.tar.gz |
Step one of replacing devsw->d_maxio with si_bsize_max.
Rename dev->si_bsize_max to si_iosize_max and set it in spec_open
if the device didn't.
Set vp->v_maxio from dev->si_bsize_max in spec_open rather than
in ufs_bmap.c
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/ext2fs/ext2_bmap.c | 39 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_bmap.c | 39 |
2 files changed, 8 insertions, 70 deletions
diff --git a/sys/gnu/ext2fs/ext2_bmap.c b/sys/gnu/ext2fs/ext2_bmap.c index cf56407..d200b36 100644 --- a/sys/gnu/ext2fs/ext2_bmap.c +++ b/sys/gnu/ext2fs/ext2_bmap.c @@ -132,41 +132,10 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb) *runb = 0; } - maxrun = 0; - if (runp || runb || (vp->v_maxio == 0)) { - - struct vnode *devvp; - int blksize; - - blksize = mp->mnt_stat.f_iosize; - - /* - * XXX - * If MAXPHYS is the largest transfer the disks can handle, - * we probably want maxrun to be 1 block less so that we - * don't create a block larger than the device can handle. - */ - devvp = ip->i_devvp; - - if (devvp != NULL && devvp->v_tag != VT_MFS && - devvp->v_type == VBLK) { - if (devsw(devvp->v_rdev)->d_maxio > MAXPHYS) { - maxrun = MAXPHYS; - vp->v_maxio = MAXPHYS; - } else { - maxrun = devsw(devvp->v_rdev)->d_maxio; - vp->v_maxio = devsw(devvp->v_rdev)->d_maxio; - } - maxrun = maxrun / blksize; - maxrun -= 1; - } - - if (maxrun <= 0) { - vp->v_maxio = DFLTPHYS; - maxrun = DFLTPHYS / blksize; - maxrun -= 1; - } - } + if (vn_isdisk(vp)) + maxrun = vp->v_rdev->si_iosize_max / mp->mnt_stat.f_iosize - 1; + else + maxrun = 0; xap = ap == NULL ? a : ap; if (!nump) diff --git a/sys/gnu/fs/ext2fs/ext2_bmap.c b/sys/gnu/fs/ext2fs/ext2_bmap.c index cf56407..d200b36 100644 --- a/sys/gnu/fs/ext2fs/ext2_bmap.c +++ b/sys/gnu/fs/ext2fs/ext2_bmap.c @@ -132,41 +132,10 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb) *runb = 0; } - maxrun = 0; - if (runp || runb || (vp->v_maxio == 0)) { - - struct vnode *devvp; - int blksize; - - blksize = mp->mnt_stat.f_iosize; - - /* - * XXX - * If MAXPHYS is the largest transfer the disks can handle, - * we probably want maxrun to be 1 block less so that we - * don't create a block larger than the device can handle. - */ - devvp = ip->i_devvp; - - if (devvp != NULL && devvp->v_tag != VT_MFS && - devvp->v_type == VBLK) { - if (devsw(devvp->v_rdev)->d_maxio > MAXPHYS) { - maxrun = MAXPHYS; - vp->v_maxio = MAXPHYS; - } else { - maxrun = devsw(devvp->v_rdev)->d_maxio; - vp->v_maxio = devsw(devvp->v_rdev)->d_maxio; - } - maxrun = maxrun / blksize; - maxrun -= 1; - } - - if (maxrun <= 0) { - vp->v_maxio = DFLTPHYS; - maxrun = DFLTPHYS / blksize; - maxrun -= 1; - } - } + if (vn_isdisk(vp)) + maxrun = vp->v_rdev->si_iosize_max / mp->mnt_stat.f_iosize - 1; + else + maxrun = 0; xap = ap == NULL ? a : ap; if (!nump) |