Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern get pointer to v_interlock directly



details:   https://anonhg.NetBSD.org/src/rev/4d7cbf434805
branches:  trunk
changeset: 546637:4d7cbf434805
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat May 03 11:19:05 2003 +0000

description:
get pointer to v_interlock directly
as we are not interested in the rest of the vnode here.

diffstat:

 sys/kern/vfs_lockf.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r b88069652ce9 -r 4d7cbf434805 sys/kern/vfs_lockf.c
--- a/sys/kern/vfs_lockf.c      Sat May 03 10:03:55 2003 +0000
+++ b/sys/kern/vfs_lockf.c      Sat May 03 11:19:05 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lockf.c,v 1.29 2003/05/01 15:25:06 yamt Exp $      */
+/*     $NetBSD: vfs_lockf.c,v 1.30 2003/05/03 11:19:05 yamt Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lockf.c,v 1.29 2003/05/01 15:25:06 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lockf.c,v 1.30 2003/05/03 11:19:05 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -106,7 +106,7 @@
        struct flock *fl = ap->a_fl;
        struct lockf *lock = NULL;
        struct lockf *sparelock;
-       struct vnode *vp = ap->a_vp;
+       struct simplelock *interlock = &ap->a_vp->v_interlock;
        off_t start, end;
        int error;
 
@@ -171,7 +171,7 @@
                goto quit;
        }
 
-       simple_lock(&vp->v_interlock);
+       simple_lock(interlock);
 
        /*
         * Avoid the common case of unlocking when inode has no locks.
@@ -216,7 +216,7 @@
        switch (ap->a_op) {
 
        case F_SETLK:
-               error = lf_setlock(lock, &sparelock, &vp->v_interlock);
+               error = lf_setlock(lock, &sparelock, interlock);
                lock = NULL; /* lf_setlock freed it */
                break;
 
@@ -233,7 +233,7 @@
        }
 
 quit_unlock:
-       simple_unlock(&vp->v_interlock);
+       simple_unlock(interlock);
 quit:
        if (lock)
                FREE(lock, M_LOCKF);



Home | Main Index | Thread Index | Old Index