Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Simplify: eliminate a now-needless unlock/lock cycle.
details: https://anonhg.NetBSD.org/src/rev/cd712539edc8
branches: trunk
changeset: 352824:cd712539edc8
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Apr 11 14:45:46 2017 +0000
description:
Simplify: eliminate a now-needless unlock/lock cycle.
diffstat:
sys/kern/vfs_vnode.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diffs (41 lines):
diff -r ef375194c5d2 -r cd712539edc8 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Tue Apr 11 14:37:07 2017 +0000
+++ b/sys/kern/vfs_vnode.c Tue Apr 11 14:45:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.82 2017/04/11 14:25:00 riastradh Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.83 2017/04/11 14:45:46 riastradh Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.82 2017/04/11 14:25:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.83 2017/04/11 14:45:46 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -765,12 +765,8 @@
*/
recycle = false;
VOP_INACTIVE(vp, &recycle);
- VOP_UNLOCK(vp);
- if (recycle) {
- /* vcache_reclaim() below will drop the lock. */
- if (vn_lock(vp, LK_EXCLUSIVE) != 0)
- recycle = false;
- }
+ if (!recycle)
+ VOP_UNLOCK(vp);
mutex_enter(vp->v_interlock);
VSTATE_CHANGE(vp, VS_BLOCKED, VS_ACTIVE);
if (!recycle) {
@@ -796,6 +792,7 @@
*/
if (recycle) {
VSTATE_ASSERT(vp, VS_ACTIVE);
+ /* vcache_reclaim drops the lock. */
vcache_reclaim(vp);
}
KASSERT(vp->v_usecount > 0);
Home |
Main Index |
Thread Index |
Old Index