Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 1999 12:41:36 +0200
From:      Poul-Henning Kamp <phk@freebsd.org>
To:        current@freebsd.org
Subject:   patch: v_maxio -> mnt_maxio
Message-ID:  <25271.938515296@critter.freebsd.dk>

next in thread | raw e-mail | index | archive | help

This patch moves the maxio information from all vnodes to the 
mountpoint.  It is a property of the device being mounted, not
of the individual vnodes on the mounted device.

Poul-Henning

Index: kern/vfs_cluster.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_cluster.c,v
retrieving revision 1.90
diff -u -r1.90 vfs_cluster.c
--- vfs_cluster.c	1999/09/20 19:53:23	1.90
+++ vfs_cluster.c	1999/09/28 08:41:26
@@ -106,7 +106,7 @@
 	 * 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_maxio/size;
 	maxra = 2 * racluster + (totread / size);
 	if (maxra > MAXRA)
 		maxra = MAXRA;
@@ -363,7 +363,7 @@
 	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_maxio)
 				break;
 
 			if ((tbp = incore(vp, lbn + i)) != NULL) {
@@ -556,7 +556,7 @@
 
 	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_maxio / lblocksize - 1;
 		if (vp->v_clen != 0) {
 			/*
 			 * Next block is not sequential.
@@ -761,7 +761,7 @@
 				  ((bp->b_blkno + (dbsize * i)) !=
 				    tbp->b_blkno) ||
 				  ((tbp->b_npages + bp->b_npages) >
-				    (vp->v_maxio / PAGE_SIZE))) {
+				    (vp->v_mount->mnt_maxio / PAGE_SIZE))) {
 					BUF_UNLOCK(tbp);
 					splx(s);
 					break;
Index: kern/vfs_subr.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.228
diff -u -r1.228 vfs_subr.c
--- vfs_subr.c	1999/09/21 00:36:15	1.228
+++ vfs_subr.c	1999/09/28 08:41:40
@@ -593,7 +593,6 @@
 	*vpp = vp;
 	vp->v_usecount = 1;
 	vp->v_data = 0;
-	vp->v_maxio = DFLTPHYS;
 	splx(s);
 
 	vfs_object_create(vp, p, p->p_ucred);
Index: kern/vfs_syscalls.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.136
diff -u -r1.136 vfs_syscalls.c
--- vfs_syscalls.c	1999/09/25 14:14:21	1.136
+++ vfs_syscalls.c	1999/09/28 08:47:32
@@ -278,6 +278,7 @@
 	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_maxio = DFLTPHYS;
 	VOP_UNLOCK(vp, 0, p);
 update:
 	/*
Index: miscfs/specfs/spec_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/miscfs/specfs/spec_vnops.c,v
retrieving revision 1.114
diff -u -r1.114 spec_vnops.c
--- spec_vnops.c	1999/09/25 18:52:03	1.114
+++ spec_vnops.c	1999/09/28 08:42:11
@@ -251,13 +251,6 @@
 		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);
 }
 
Index: sys/mount.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/mount.h,v
retrieving revision 1.79
diff -u -r1.79 mount.h
--- mount.h	1999/09/19 06:24:21	1.79
+++ mount.h	1999/09/28 08:36:42
@@ -110,6 +110,7 @@
 	struct statfs	mnt_stat;		/* cache of filesystem stats */
 	qaddr_t		mnt_data;		/* private data */
 	time_t		mnt_time;		/* last time written*/
+	u_int		mnt_maxio;		/* Max io request size */
 };
 
 /*
Index: sys/vnode.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/vnode.h,v
retrieving revision 1.101
diff -u -r1.101 vnode.h
--- vnode.h	1999/09/21 00:36:15	1.101
+++ vnode.h	1999/09/28 08:36:52
@@ -111,7 +111,6 @@
 	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 */
Index: ufs/ffs/ffs_vfsops.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v
retrieving revision 1.105
diff -u -r1.105 ffs_vfsops.c
--- ffs_vfsops.c	1999/09/11 00:46:07	1.105
+++ ffs_vfsops.c	1999/09/28 08:56:01
@@ -620,6 +620,10 @@
 	error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p);
 	if (error)
 		return (error);
+	if (devvp->v_rdev->si_iosize_max > mp->mnt_maxio)
+		mp->mnt_maxio = devvp->v_rdev->si_iosize_max;
+	if (mp->mnt_maxio > MAXPHYS)
+		mp->mnt_maxio = MAXPHYS;
 
 	if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, cred, p) != 0)
 		size = DEV_BSIZE;
Index: ufs/ufs/ufs_bmap.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ufs/ufs_bmap.c,v
retrieving revision 1.33
diff -u -r1.33 ufs_bmap.c
--- ufs_bmap.c	1999/09/20 21:14:43	1.33
+++ ufs_bmap.c	1999/09/28 08:39:52
@@ -133,8 +133,7 @@
 		*runb = 0;
 	}
 
-	vp->v_maxio = devvp->v_maxio;
-	maxrun = vp->v_maxio / mp->mnt_stat.f_iosize - 1;
+	maxrun = mp->mnt_maxio / mp->mnt_stat.f_iosize - 1;
 
 	xap = ap == NULL ? a : ap;
 	if (!nump)
--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
FreeBSD -- It will take a long time before progress goes too far!


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25271.938515296>