Module Name:    src
Committed By:   hannken
Date:           Wed May 24 09:55:19 UTC 2017

Modified Files:
        src/sys/fs/union: union_vnops.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/fs/union/union_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/union/union_vnops.c
diff -u src/sys/fs/union/union_vnops.c:1.68 src/sys/fs/union/union_vnops.c:1.69
--- src/sys/fs/union/union_vnops.c:1.68	Sun May  7 08:22:40 2017
+++ src/sys/fs/union/union_vnops.c	Wed May 24 09:55:18 2017
@@ -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 @@ union_lock1(struct vnode *vp, struct vno
 {
 	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 @@ union_unlock1(struct vnode *vp, struct v
 {
 	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

Reply via email to