Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/union Use VCALL() to lock or unlock the lower node.



details:   https://anonhg.NetBSD.org/src/rev/cf1eb0bfc969
branches:  trunk
changeset: 824117:cf1eb0bfc969
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed May 24 09:55:18 2017 +0000

description:
Use VCALL() to lock or unlock the lower node.

diffstat:

 sys/fs/union/union_vnops.c |  26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diffs (56 lines):

diff -r 6b26411396bb -r cf1eb0bfc969 sys/fs/union/union_vnops.c
--- a/sys/fs/union/union_vnops.c        Wed May 24 09:54:40 2017 +0000
+++ b/sys/fs/union/union_vnops.c        Wed May 24 09:55:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vnops.c,v 1.68 2017/05/07 08:22:40 hannken Exp $ */
+/*     $NetBSD: union_vnops.c,v 1.69 2017/05/24 09:55:18 hannken Exp $ */
 
 /*
  * Copyright (c) 1992, 1993, 1994, 1995
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.68 2017/05/07 08:22:40 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.69 2017/05/24 09:55:18 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1600,12 +1600,14 @@
 {
        struct vop_lock_args ap;
 
-       if (lockvp == vp) {
-               ap.a_vp = vp;
-               ap.a_flags = flags;
+       ap.a_desc = VDESC(vop_lock);
+       ap.a_vp = lockvp;
+       ap.a_flags = flags;
+
+       if (lockvp == vp)
                return genfs_lock(&ap);
-       } else
-               return VOP_LOCK(lockvp, flags);
+       else
+               return VCALL(ap.a_vp, VOFFSET(vop_lock), &ap);
 }
 
 static int
@@ -1613,11 +1615,13 @@
 {
        struct vop_unlock_args ap;
 
-       if (lockvp == vp) {
-               ap.a_vp = vp;
+       ap.a_desc = VDESC(vop_unlock);
+       ap.a_vp = lockvp;
+
+       if (lockvp == vp)
                return genfs_unlock(&ap);
-       } else
-               return VOP_UNLOCK(lockvp);
+       else
+               return VCALL(ap.a_vp, VOFFSET(vop_unlock), &ap);
 }
 
 int



Home | Main Index | Thread Index | Old Index