Unfortunately MFS uses v_data of its anonymous device vnode so

it cannot be used as vcache key.  Use v_interlock as key ...
This commit is contained in:
hannken 2015-07-01 08:13:52 +00:00
parent 3b1701b0a5
commit 418d71fb1c
2 changed files with 7 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dead_vfsops.c,v 1.6 2015/06/30 06:19:22 hannken Exp $ */
/* $NetBSD: dead_vfsops.c,v 1.7 2015/07/01 08:13:53 hannken Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.6 2015/06/30 06:19:22 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.7 2015/07/01 08:13:53 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -108,9 +108,8 @@ dead_newvnode(struct mount *mp, struct vnode *dvp, struct vnode *vp,
uvm_vnp_setsize(vp, 0);
spec_node_init(vp, vap->va_rdev);
vp->v_data = vp;
*key_len = sizeof(vp->v_data);
*new_key = &vp->v_data;
*key_len = sizeof(vp->v_interlock);
*new_key = &vp->v_interlock;
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: spec_vnops.c,v 1.152 2015/06/30 06:19:21 hannken Exp $ */
/* $NetBSD: spec_vnops.c,v 1.153 2015/07/01 08:13:52 hannken Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.152 2015/06/30 06:19:21 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.153 2015/07/01 08:13:52 hannken Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -1097,8 +1097,7 @@ spec_reclaim(void *v)
struct vnode *vp = ap->a_vp;
KASSERT(vp->v_mount == dead_rootmount);
vcache_remove(vp->v_mount, &vp->v_data, sizeof(vp->v_data));
vp->v_data = NULL;
vcache_remove(vp->v_mount, &vp->v_interlock, sizeof(vp->v_interlock));
return 0;
}