Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/union Update the (shared) v_interlock if the upper no...



details:   https://anonhg.NetBSD.org/src/rev/fd91657a956c
branches:  trunk
changeset: 768180:fd91657a956c
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Aug 10 15:56:01 2011 +0000

description:
Update the (shared) v_interlock if the upper node changes.

diffstat:

 sys/fs/union/union_subr.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 3594bc6b2033 -r fd91657a956c sys/fs/union/union_subr.c
--- a/sys/fs/union/union_subr.c Wed Aug 10 12:13:20 2011 +0000
+++ b/sys/fs/union/union_subr.c Wed Aug 10 15:56:01 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_subr.c,v 1.45 2011/08/10 06:19:54 hannken Exp $  */
+/*     $NetBSD: union_subr.c,v 1.46 2011/08/10 15:56:01 hannken Exp $  */
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.45 2011/08/10 06:19:54 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_subr.c,v 1.46 2011/08/10 15:56:01 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -223,6 +223,12 @@
 
                un->un_uppervp = uppervp;
                un->un_uppersz = VNOVAL;
+               /* Update union vnode interlock. */
+               if (uppervp != NULL) {
+                       mutex_obj_hold(uppervp->v_interlock);
+                       uvm_obj_setlock(&UNIONTOV(un)->v_uobj,
+                           uppervp->v_interlock);
+               }
        }
 
        if (docache && (ohash != nhash)) {



Home | Main Index | Thread Index | Old Index