Remove v_maxio from struct vnode.

Replace it with mnt_iosize_max in struct mount.

Nits from:	bde
This commit is contained in:
Poul-Henning Kamp 1999-09-29 20:05:33 +00:00
parent 13e14363fe
commit 1b5464ef9d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51797
13 changed files with 16 additions and 27 deletions

View File

@ -251,13 +251,6 @@ spec_open(ap)
if (!dev->si_bsize_phys)
dev->si_bsize_phys = DEV_BSIZE;
}
maxio = dev->si_iosize_max;
if (!maxio)
maxio = DFLTPHYS;
if (maxio > MAXPHYS)
maxio = MAXPHYS;
vp->v_maxio = maxio;
return (error);
}

View File

@ -133,8 +133,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*runb = 0;
}
vp->v_maxio = devvp->v_maxio;
maxrun = vp->v_maxio / mp->mnt_stat.f_iosize - 1;
maxrun = mp->mnt_iosize_max / mp->mnt_stat.f_iosize - 1;
xap = ap == NULL ? a : ap;
if (!nump)

View File

@ -133,8 +133,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*runb = 0;
}
vp->v_maxio = devvp->v_maxio;
maxrun = vp->v_maxio / mp->mnt_stat.f_iosize - 1;
maxrun = mp->mnt_iosize_max / mp->mnt_stat.f_iosize - 1;
xap = ap == NULL ? a : ap;
if (!nump)

View File

@ -106,7 +106,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
* Try to limit the amount of read-ahead by a few
* ad-hoc parameters. This needs work!!!
*/
racluster = vp->v_maxio/size;
racluster = vp->v_mount->mnt_iosize_max / size;
maxra = 2 * racluster + (totread / size);
if (maxra > MAXRA)
maxra = MAXRA;
@ -363,7 +363,7 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
for (bn = blkno, i = 0; i < run; ++i, bn += inc) {
if (i != 0) {
if ((bp->b_npages * PAGE_SIZE) +
round_page(size) > vp->v_maxio)
round_page(size) > vp->v_mount->mnt_iosize_max)
break;
if ((tbp = incore(vp, lbn + i)) != NULL) {
@ -556,7 +556,7 @@ cluster_write(bp, filesize)
if (vp->v_clen == 0 || lbn != vp->v_lastw + 1 ||
(bp->b_blkno != vp->v_lasta + btodb(lblocksize))) {
maxclen = vp->v_maxio / lblocksize - 1;
maxclen = vp->v_mount->mnt_iosize_max / lblocksize - 1;
if (vp->v_clen != 0) {
/*
* Next block is not sequential.
@ -761,7 +761,7 @@ cluster_wbuild(vp, size, start_lbn, len)
((bp->b_blkno + (dbsize * i)) !=
tbp->b_blkno) ||
((tbp->b_npages + bp->b_npages) >
(vp->v_maxio / PAGE_SIZE))) {
(vp->v_mount->mnt_iosize_max / PAGE_SIZE))) {
BUF_UNLOCK(tbp);
splx(s);
break;

View File

@ -272,6 +272,7 @@ vfs_rootmountalloc(fstypename, devname, mpp)
mp->mnt_flag = MNT_RDONLY;
mp->mnt_vnodecovered = NULLVP;
vfsp->vfc_refcount++;
mp->mnt_iosize_max = DFLTPHYS;
mp->mnt_stat.f_type = vfsp->vfc_typenum;
mp->mnt_flag |= vfsp->vfc_flags & MNT_VISFLAGMASK;
strncpy(mp->mnt_stat.f_fstypename, vfsp->vfc_name, MFSNAMELEN);
@ -593,7 +594,6 @@ getnewvnode(tag, mp, vops, vpp)
*vpp = vp;
vp->v_usecount = 1;
vp->v_data = 0;
vp->v_maxio = DFLTPHYS;
splx(s);
vfs_object_create(vp, p, p->p_ucred);

View File

@ -278,6 +278,7 @@ mount(p, uap)
strncpy(mp->mnt_stat.f_fstypename, vfsp->vfc_name, MFSNAMELEN);
mp->mnt_vnodecovered = vp;
mp->mnt_stat.f_owner = p->p_ucred->cr_uid;
mp->mnt_iosize_max = DFLTPHYS;
VOP_UNLOCK(vp, 0, p);
update:
/*

View File

@ -272,6 +272,7 @@ vfs_rootmountalloc(fstypename, devname, mpp)
mp->mnt_flag = MNT_RDONLY;
mp->mnt_vnodecovered = NULLVP;
vfsp->vfc_refcount++;
mp->mnt_iosize_max = DFLTPHYS;
mp->mnt_stat.f_type = vfsp->vfc_typenum;
mp->mnt_flag |= vfsp->vfc_flags & MNT_VISFLAGMASK;
strncpy(mp->mnt_stat.f_fstypename, vfsp->vfc_name, MFSNAMELEN);
@ -593,7 +594,6 @@ getnewvnode(tag, mp, vops, vpp)
*vpp = vp;
vp->v_usecount = 1;
vp->v_data = 0;
vp->v_maxio = DFLTPHYS;
splx(s);
vfs_object_create(vp, p, p->p_ucred);

View File

@ -278,6 +278,7 @@ mount(p, uap)
strncpy(mp->mnt_stat.f_fstypename, vfsp->vfc_name, MFSNAMELEN);
mp->mnt_vnodecovered = vp;
mp->mnt_stat.f_owner = p->p_ucred->cr_uid;
mp->mnt_iosize_max = DFLTPHYS;
VOP_UNLOCK(vp, 0, p);
update:
/*

View File

@ -251,13 +251,6 @@ spec_open(ap)
if (!dev->si_bsize_phys)
dev->si_bsize_phys = DEV_BSIZE;
}
maxio = dev->si_iosize_max;
if (!maxio)
maxio = DFLTPHYS;
if (maxio > MAXPHYS)
maxio = MAXPHYS;
vp->v_maxio = maxio;
return (error);
}

View File

@ -110,6 +110,7 @@ struct mount {
struct statfs mnt_stat; /* cache of filesystem stats */
qaddr_t mnt_data; /* private data */
time_t mnt_time; /* last time written*/
u_int mnt_iosize_max; /* max IO request size */
};
/*

View File

@ -111,7 +111,6 @@ struct vnode {
daddr_t v_cstart; /* start block of cluster */
daddr_t v_lasta; /* last allocation */
int v_clen; /* length of current cluster */
int v_maxio; /* maximum I/O cluster size */
struct vm_object *v_object; /* Place to store VM object */
struct simplelock v_interlock; /* lock on usecount and flag */
struct lock *v_vnlock; /* used for non-locking fs's */

View File

@ -620,6 +620,10 @@ ffs_mountfs(devvp, mp, p, malloctype)
error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
if (error)
return (error);
if (devvp->v_rdev->si_iosize_max > mp->mnt_iosize_max)
mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max;
if (mp->mnt_iosize_max > MAXPHYS)
mp->mnt_iosize_max = MAXPHYS;
if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, cred, p) != 0)
size = DEV_BSIZE;

View File

@ -133,8 +133,7 @@ ufs_bmaparray(vp, bn, bnp, ap, nump, runp, runb)
*runb = 0;
}
vp->v_maxio = devvp->v_maxio;
maxrun = vp->v_maxio / mp->mnt_stat.f_iosize - 1;
maxrun = mp->mnt_iosize_max / mp->mnt_stat.f_iosize - 1;
xap = ap == NULL ? a : ap;
if (!nump)