summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-10-27 15:26:23 +0000
committerbde <bde@FreeBSD.org>1997-10-27 15:26:23 +0000
commitbd7b557dd668eb1f10b688e8874364a36536c660 (patch)
tree9016a91661228111de2a931ca443301bbfd60fca
parent4cd9d808cf40254677887f0863d5987dfadcda6b (diff)
downloadFreeBSD-src-bd7b557dd668eb1f10b688e8874364a36536c660.zip
FreeBSD-src-bd7b557dd668eb1f10b688e8874364a36536c660.tar.gz
Use 127 instead of CHAR_MAX for the limit on the sequence count. The
limit doesn't have anything to do with characters. The count mainly needs to fit in the VOP_READ() ioflag after being left shifted by 16. Moved vn_lock() before vn_closefile(). vn_lock() was mismerged from Lite2. Removed some gratuitous braces.
-rw-r--r--sys/kern/vfs_vnops.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 1117ef5..19f35b0 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
- * $Id: vfs_vnops.c,v 1.38 1997/09/14 02:51:16 peter Exp $
+ * $Id: vfs_vnops.c,v 1.39 1997/10/06 02:38:27 dyson Exp $
*/
#include <sys/param.h>
@@ -298,8 +298,8 @@ vn_read(fp, uio, cred)
* are.
*/
tmpseq += ((count + BKVASIZE - 1) / BKVASIZE);
- if (tmpseq >= CHAR_MAX)
- tmpseq = CHAR_MAX;
+ if (tmpseq >= 127)
+ tmpseq = 127;
fp->f_seqcount = tmpseq;
flag |= (fp->f_seqcount << 16);
} else {
@@ -491,19 +491,6 @@ vn_poll(fp, events, cred, p)
}
/*
- * File table vnode close routine.
- */
-static int
-vn_closefile(fp, p)
- struct file *fp;
- struct proc *p;
-{
-
- return (vn_close(((struct vnode *)fp->f_data), fp->f_flag,
- fp->f_cred, p));
-}
-
-/*
* Check that the vnode is still valid, and if so
* acquire requested lock.
*/
@@ -516,9 +503,8 @@ vn_lock(vp, flags, p)
int error;
do {
- if ((flags & LK_INTERLOCK) == 0) {
+ if ((flags & LK_INTERLOCK) == 0)
simple_lock(&vp->v_interlock);
- }
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
@@ -533,3 +519,16 @@ vn_lock(vp, flags, p)
} while (flags & LK_RETRY);
return (error);
}
+
+/*
+ * File table vnode close routine.
+ */
+static int
+vn_closefile(fp, p)
+ struct file *fp;
+ struct proc *p;
+{
+
+ return (vn_close(((struct vnode *)fp->f_data), fp->f_flag,
+ fp->f_cred, p));
+}
OpenPOWER on IntegriCloud