Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/coda v_interlock -> vmobjloc
details: https://anonhg.NetBSD.org/src/rev/a381453fa26c
branches: trunk
changeset: 745195:a381453fa26c
user: ad <ad%NetBSD.org@localhost>
date: Mon Feb 24 20:53:11 2020 +0000
description:
v_interlock -> vmobjloc
diffstat:
sys/coda/coda_vnops.c | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diffs (96 lines):
diff -r 28c7875dc37a -r a381453fa26c sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c Mon Feb 24 20:49:51 2020 +0000
+++ b/sys/coda/coda_vnops.c Mon Feb 24 20:53:11 2020 +0000
@@ -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 @@
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 @@
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 @@
* 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 @@
* 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 @@
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 @@
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 @@
*/
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. */
Home |
Main Index |
Thread Index |
Old Index