Module Name: src Committed By: ad Date: Mon Feb 24 20:53:11 UTC 2020
Modified Files: src/sys/coda: coda_vnops.c Log Message: v_interlock -> vmobjloc To generate a diff of this commit: cvs rdiff -u -r1.109 -r1.110 src/sys/coda/coda_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/coda/coda_vnops.c diff -u src/sys/coda/coda_vnops.c:1.109 src/sys/coda/coda_vnops.c:1.110 --- src/sys/coda/coda_vnops.c:1.109 Sun Feb 23 15:46:39 2020 +++ src/sys/coda/coda_vnops.c Mon Feb 24 20:53:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: coda_vnops.c,v 1.109 2020/02/23 15:46:39 ad Exp $ */ +/* $NetBSD: coda_vnops.c,v 1.110 2020/02/24 20:53:11 ad Exp $ */ /* * @@ -46,7 +46,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.109 2020/02/23 15:46:39 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.110 2020/02/24 20:53:11 ad Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1889,6 +1889,7 @@ coda_getpages(void *v) int error, cerror; int waslocked; /* 1 if vnode lock was held on entry */ int didopen = 0; /* 1 if we opened container file */ + krw_t op; /* * Handle a case that uvm_fault doesn't quite use yet. @@ -1898,7 +1899,7 @@ coda_getpages(void *v) return EBUSY; } - KASSERT(mutex_owned(vp->v_interlock)); + KASSERT(rw_lock_held(vp->v_uobj.vmobjlock)); /* Check for control object. */ if (IS_CTL_VP(vp)) { @@ -1917,6 +1918,7 @@ coda_getpages(void *v) * mechanism. */ /* XXX VOP_ISLOCKED() may not be used for lock decisions. */ + op = rw_lock_op(vp->v_uobj.vmobjlock); waslocked = VOP_ISLOCKED(vp); /* Get container file if not already present. */ @@ -1928,7 +1930,7 @@ coda_getpages(void *v) * leave it in the same state on exit. */ if (waslocked == 0) { - mutex_exit(vp->v_interlock); + rw_exit(vp->v_uobj.vmobjlock); cerror = vn_lock(vp, LK_EXCLUSIVE); if (cerror) { #ifdef CODA_VERBOSE @@ -1966,12 +1968,12 @@ coda_getpages(void *v) cvp = cp->c_ovp; didopen = 1; if (waslocked == 0) - mutex_enter(vp->v_interlock); + rw_enter(vp->v_uobj.vmobjlock, op); } KASSERT(cvp != NULL); /* Munge the arg structure to refer to the container vnode. */ - KASSERT(cvp->v_interlock == vp->v_interlock); + KASSERT(cvp->v_uobj.vmobjlock == vp->v_uobj.vmobjlock); ap->a_vp = cp->c_ovp; /* Finally, call getpages on it. */ @@ -2015,11 +2017,11 @@ coda_putpages(void *v) struct cnode *cp = VTOC(vp); int error; - KASSERT(mutex_owned(vp->v_interlock)); + KASSERT(rw_write_held(vp->v_uobj.vmobjlock)); /* Check for control object. */ if (IS_CTL_VP(vp)) { - mutex_exit(vp->v_interlock); + rw_exit(vp->v_uobj.vmobjlock); #ifdef CODA_VERBOSE printf("%s: control object %p\n", __func__, vp); #endif @@ -2034,12 +2036,12 @@ coda_putpages(void *v) */ cvp = cp->c_ovp; if (cvp == NULL) { - mutex_exit(vp->v_interlock); + rw_exit(vp->v_uobj.vmobjlock); return 0; } /* Munge the arg structure to refer to the container vnode. */ - KASSERT(cvp->v_interlock == vp->v_interlock); + KASSERT(cvp->v_uobj.vmobjlock == vp->v_uobj.vmobjlock); ap->a_vp = cvp; /* Finally, call putpages on it. */