From 7f7aad09bd3ba80788d63c72e2c6a5b4f3bfcaac Mon Sep 17 00:00:00 2001 From: riastradh Date: Fri, 26 May 2017 14:20:59 +0000 Subject: [PATCH] Make VOP_RECLAIM do the last unlock of the vnode. VOP_RECLAIM naturally has exclusive access to the vnode, so having it locked on entry is not strictly necessary -- but it means if there are any final operations that must be done on the vnode, such as ffs_update, requiring exclusive access to it, we can now kassert that the vnode is locked in those operations. We can't just have the caller release the last lock because some file systems don't use genfs_lock, and require the vnode to remain valid for VOP_UNLOCK to work, notably unionfs. --- external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c | 3 ++- sys/coda/coda_vnops.c | 8 +++++--- sys/fs/adosfs/advnops.c | 8 +++++--- sys/fs/cd9660/cd9660_node.c | 8 +++++--- sys/fs/efs/efs_vnops.c | 8 +++++--- sys/fs/filecorefs/filecore_node.c | 8 +++++--- sys/fs/hfs/hfs_vnops.c | 10 ++++++---- sys/fs/msdosfs/msdosfs_denode.c | 8 +++++--- sys/fs/nilfs/nilfs_vnops.c | 8 +++++--- sys/fs/ntfs/ntfs_vnops.c | 8 +++++--- sys/fs/ptyfs/ptyfs_vnops.c | 8 +++++--- sys/fs/puffs/puffs_vnops.c | 8 +++++--- sys/fs/smbfs/smbfs_node.c | 8 +++++--- sys/fs/sysvbfs/sysvbfs_vnops.c | 8 +++++--- sys/fs/tmpfs/tmpfs_vnops.c | 9 ++++++--- sys/fs/udf/udf_vnops.c | 8 +++++--- sys/fs/union/union_vnops.c | 8 +++++--- sys/fs/unionfs/unionfs_vnops.c | 4 +++- sys/fs/v7fs/v7fs_vnops.c | 8 +++++--- sys/kern/vfs_vnode.c | 5 ++--- sys/kern/vnode_if.src | 7 ++++--- sys/miscfs/fdesc/fdesc_vnops.c | 8 +++++--- sys/miscfs/genfs/layer_vnops.c | 8 +++++--- sys/miscfs/kernfs/kernfs_vnops.c | 8 +++++--- sys/miscfs/procfs/procfs_vnops.c | 8 +++++--- sys/miscfs/specfs/spec_vnops.c | 10 ++++++---- sys/nfs/nfs_node.c | 8 +++++--- sys/rump/librump/rumpvfs/rumpfs.c | 8 +++++--- sys/ufs/chfs/chfs_vnops.c | 6 ++++-- sys/ufs/ext2fs/ext2fs_vnops.c | 8 +++++--- sys/ufs/ffs/ffs_vnops.c | 8 +++++--- sys/ufs/lfs/lfs_vnops.c | 8 +++++--- sys/ufs/mfs/mfs_vnops.c | 8 +++++--- 33 files changed, 158 insertions(+), 96 deletions(-) diff --git a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c index 91465ef9319d..21390f302490 100644 --- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c +++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c @@ -5537,7 +5537,7 @@ zfs_netbsd_inactive(void *v) static int zfs_netbsd_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; @@ -5546,6 +5546,7 @@ zfs_netbsd_reclaim(void *v) int error; KASSERT(vp != NULL); + VOP_UNLOCK(vp); zp = VTOZ(vp); KASSERT(zp != NULL); zfsvfs = zp->z_zfsvfs; diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c index 7174ba15b370..e6b372fe933b 100644 --- a/sys/coda/coda_vnops.c +++ b/sys/coda/coda_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: coda_vnops.c,v 1.105 2017/04/26 03:02:48 riastradh Exp $ */ +/* $NetBSD: coda_vnops.c,v 1.106 2017/05/26 14:21:00 riastradh Exp $ */ /* * @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.105 2017/04/26 03:02:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.106 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -1632,12 +1632,14 @@ int coda_reclaim(void *v) { /* true args */ - struct vop_reclaim_args *ap = v; + struct vop_reclaim_v2_args *ap = v; vnode_t *vp = ap->a_vp; struct cnode *cp = VTOC(vp); /* upcall decl */ /* locals */ + VOP_UNLOCK(vp); + /* * Forced unmount/flush will let vnodes with non zero use be destroyed! */ diff --git a/sys/fs/adosfs/advnops.c b/sys/fs/adosfs/advnops.c index 92521a420484..1f8361144529 100644 --- a/sys/fs/adosfs/advnops.c +++ b/sys/fs/adosfs/advnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: advnops.c,v 1.49 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: advnops.c,v 1.50 2017/05/26 14:21:00 riastradh Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.49 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.50 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -866,12 +866,14 @@ adosfs_inactive(void *v) int adosfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *sp = v; struct vnode *vp; struct anode *ap; + VOP_UNLOCK(sp->a_vp); + #ifdef ADOSFS_DIAGNOSTIC printf("(reclaim 0)"); #endif diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c index 379e9cdf4889..81f013831068 100644 --- a/sys/fs/cd9660/cd9660_node.c +++ b/sys/fs/cd9660/cd9660_node.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_node.c,v 1.36 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: cd9660_node.c,v 1.37 2017/05/26 14:21:00 riastradh Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1994 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.36 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.37 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -125,12 +125,14 @@ cd9660_inactive(void *v) int cd9660_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; struct lwp *a_l; } */ *ap = v; struct vnode *vp = ap->a_vp; + VOP_UNLOCK(vp); + if (prtactive && vp->v_usecount > 1) vprint("cd9660_reclaim: pushing active", vp); /* diff --git a/sys/fs/efs/efs_vnops.c b/sys/fs/efs/efs_vnops.c index e60baf58efcf..161bae79a420 100644 --- a/sys/fs/efs/efs_vnops.c +++ b/sys/fs/efs/efs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: efs_vnops.c,v 1.37 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: efs_vnops.c,v 1.38 2017/05/26 14:21:00 riastradh Exp $ */ /* * Copyright (c) 2006 Stephen M. Rumble @@ -17,7 +17,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.37 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.38 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -575,13 +575,15 @@ efs_inactive(void *v) static int efs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { const struct vnodeop_desc *a_desc; struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct efs_inode *eip = EFS_VTOI(vp); + VOP_UNLOCK(vp); + genfs_node_destroy(vp); pool_put(&efs_inode_pool, eip); vp->v_data = NULL; diff --git a/sys/fs/filecorefs/filecore_node.c b/sys/fs/filecorefs/filecore_node.c index c57b0f74abe2..bdd7036c0591 100644 --- a/sys/fs/filecorefs/filecore_node.c +++ b/sys/fs/filecorefs/filecore_node.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_node.c,v 1.29 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: filecore_node.c,v 1.30 2017/05/26 14:21:00 riastradh Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1994 @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: filecore_node.c,v 1.29 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: filecore_node.c,v 1.30 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -237,13 +237,15 @@ filecore_inactive(void *v) int filecore_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; struct lwp *a_l; } */ *ap = v; struct vnode *vp = ap->a_vp; struct filecore_node *ip = VTOI(vp); + VOP_UNLOCK(vp); + if (prtactive && vp->v_usecount > 1) vprint("filecore_reclaim: pushing active", vp); diff --git a/sys/fs/hfs/hfs_vnops.c b/sys/fs/hfs/hfs_vnops.c index 1f812623f236..8a5a2d349f97 100644 --- a/sys/fs/hfs/hfs_vnops.c +++ b/sys/fs/hfs/hfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: hfs_vnops.c,v 1.33 2016/08/20 12:37:07 hannken Exp $ */ +/* $NetBSD: hfs_vnops.c,v 1.34 2017/05/26 14:21:00 riastradh Exp $ */ /*- * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hfs_vnops.c,v 1.33 2016/08/20 12:37:07 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hfs_vnops.c,v 1.34 2017/05/26 14:21:00 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -1019,12 +1019,14 @@ hfs_vop_readlink(void *v) { int hfs_vop_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp; struct hfsnode *hp; - + + VOP_UNLOCK(ap->a_vp); + DPRINTF(("VOP = hfs_vop_reclaim()\n")); vp = ap->a_vp; diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index c1cd5ed2fdf3..44e8cc8b9cc0 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_denode.c,v 1.54 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: msdosfs_denode.c,v 1.55 2017/05/26 14:21:00 riastradh Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.54 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.55 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -532,12 +532,14 @@ deextend(struct denode *dep, u_long length, kauth_cred_t cred) int msdosfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); + VOP_UNLOCK(vp); + #ifdef MSDOSFS_DEBUG printf("msdosfs_reclaim(): dep %p, file %s, refcnt %ld\n", dep, dep->de_Name, dep->de_refcnt); diff --git a/sys/fs/nilfs/nilfs_vnops.c b/sys/fs/nilfs/nilfs_vnops.c index 76377caf5b7d..57d78e4ffc74 100644 --- a/sys/fs/nilfs/nilfs_vnops.c +++ b/sys/fs/nilfs/nilfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nilfs_vnops.c,v 1.35 2017/04/26 03:02:48 riastradh Exp $ */ +/* $NetBSD: nilfs_vnops.c,v 1.36 2017/05/26 14:21:00 riastradh Exp $ */ /* * Copyright (c) 2008, 2009 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.35 2017/04/26 03:02:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.36 2017/05/26 14:21:00 riastradh Exp $"); #endif /* not lint */ @@ -99,12 +99,14 @@ nilfs_inactive(void *v) int nilfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct nilfs_node *nilfs_node = VTOI(vp); + VOP_UNLOCK(vp); + DPRINTF(NODE, ("nilfs_reclaim called for node %p\n", nilfs_node)); if (prtactive && vp->v_usecount > 1) vprint("nilfs_reclaim(): pushing active", vp); diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index b6dc8b8eae8f..5f23426d8db3 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntfs_vnops.c,v 1.61 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: ntfs_vnops.c,v 1.62 2017/05/26 14:21:00 riastradh Exp $ */ /* * Copyright (c) 1992, 1993 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.61 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.62 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -229,7 +229,7 @@ ntfs_inactive(void *v) int ntfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; @@ -238,6 +238,8 @@ ntfs_reclaim(void *v) const int attrlen = strlen(fp->f_attrname); int error; + VOP_UNLOCK(vp); + dprintf(("ntfs_reclaim: vnode: %p, ntnode: %llu\n", vp, (unsigned long long)ip->i_number)); diff --git a/sys/fs/ptyfs/ptyfs_vnops.c b/sys/fs/ptyfs/ptyfs_vnops.c index 29d19c5f9b4e..5d4f228806bf 100644 --- a/sys/fs/ptyfs/ptyfs_vnops.c +++ b/sys/fs/ptyfs/ptyfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ptyfs_vnops.c,v 1.53 2017/04/11 14:24:59 riastradh Exp $ */ +/* $NetBSD: ptyfs_vnops.c,v 1.54 2017/05/26 14:21:00 riastradh Exp $ */ /* * Copyright (c) 1993, 1995 @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.53 2017/04/11 14:24:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.54 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -219,11 +219,13 @@ const struct vnodeopv_desc ptyfs_vnodeop_opv_desc = int ptyfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; + VOP_UNLOCK(vp); + vp->v_data = NULL; return 0; } diff --git a/sys/fs/puffs/puffs_vnops.c b/sys/fs/puffs/puffs_vnops.c index 0c5bbcfd4f2b..678f9054d757 100644 --- a/sys/fs/puffs/puffs_vnops.c +++ b/sys/fs/puffs/puffs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vnops.c,v 1.210 2017/04/26 03:02:48 riastradh Exp $ */ +/* $NetBSD: puffs_vnops.c,v 1.211 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.210 2017/04/26 03:02:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.211 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -1443,7 +1443,7 @@ callreclaim(struct puffs_mount *pmp, puffs_cookie_t ck, int nlookup) int puffs_vnop_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { const struct vnodeop_desc *a_desc; struct vnode *a_vp; } */ *ap = v; @@ -1451,6 +1451,8 @@ puffs_vnop_reclaim(void *v) struct puffs_mount *pmp = MPTOPUFFSMP(vp->v_mount); bool notifyserver = true; + VOP_UNLOCK(vp); + /* * first things first: check if someone is trying to reclaim the * root vnode. do not allow that to travel to userspace. diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c index 96a130a43cb1..d10c6dad868e 100644 --- a/sys/fs/smbfs/smbfs_node.c +++ b/sys/fs/smbfs/smbfs_node.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_node.c,v 1.55 2017/04/11 14:25:00 riastradh Exp $ */ +/* $NetBSD: smbfs_node.c,v 1.56 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 2000-2001 Boris Popov @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.55 2017/04/11 14:25:00 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.56 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -213,7 +213,7 @@ out: int smbfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; struct thread *a_p; } */ *ap = v; @@ -222,6 +222,8 @@ smbfs_reclaim(void *v) struct smbnode *np = VTOSMB(vp); struct smbmount *smp = VTOSMBFS(vp); + VOP_UNLOCK(vp); + if (prtactive && vp->v_usecount > 1) vprint("smbfs_reclaim(): pushing active", vp); diff --git a/sys/fs/sysvbfs/sysvbfs_vnops.c b/sys/fs/sysvbfs/sysvbfs_vnops.c index cc0e524f73a5..a6bb22ba2da1 100644 --- a/sys/fs/sysvbfs/sysvbfs_vnops.c +++ b/sys/fs/sysvbfs/sysvbfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysvbfs_vnops.c,v 1.62 2017/04/26 03:02:48 riastradh Exp $ */ +/* $NetBSD: sysvbfs_vnops.c,v 1.63 2017/05/26 14:21:01 riastradh Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.62 2017/04/26 03:02:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vnops.c,v 1.63 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -697,13 +697,15 @@ int sysvbfs_reclaim(void *v) { extern struct pool sysvbfs_node_pool; - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct sysvbfs_node *bnode = vp->v_data; struct bfs *bfs = bnode->bmp->bfs; + VOP_UNLOCK(vp); + DPRINTF("%s:\n", __func__); if (bnode->removed) { diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index c0a2820270ff..9eb23db84d0a 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs_vnops.c,v 1.132 2017/04/26 03:02:48 riastradh Exp $ */ +/* $NetBSD: tmpfs_vnops.c,v 1.133 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.132 2017/04/26 03:02:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.133 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -1060,13 +1060,16 @@ tmpfs_inactive(void *v) int tmpfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; vnode_t *vp = ap->a_vp; tmpfs_mount_t *tmp = VFS_TO_TMPFS(vp->v_mount); tmpfs_node_t *node = VP_TO_TMPFS_NODE(vp); + /* Unlock vnode. We still have exclusive access to it. */ + VOP_UNLOCK(vp); + /* Disassociate inode from vnode. */ node->tn_vnode = NULL; vp->v_data = NULL; diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 52df509044ed..f9e4a8f85f42 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_vnops.c,v 1.104 2017/04/26 03:02:48 riastradh Exp $ */ +/* $NetBSD: udf_vnops.c,v 1.105 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -32,7 +32,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.104 2017/04/26 03:02:48 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.105 2017/05/26 14:21:01 riastradh Exp $"); #endif /* not lint */ @@ -129,13 +129,15 @@ udf_inactive(void *v) int udf_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct udf_node *udf_node = VTOI(vp); int refcnt; + VOP_UNLOCK(vp); + DPRINTF(NODE, ("udf_reclaim called for node %p\n", udf_node)); if (prtactive && vp->v_usecount > 1) vprint("udf_reclaim(): pushing active", vp); diff --git a/sys/fs/union/union_vnops.c b/sys/fs/union/union_vnops.c index ef05cb793e0a..7593ccc1150e 100644 --- a/sys/fs/union/union_vnops.c +++ b/sys/fs/union/union_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: union_vnops.c,v 1.69 2017/05/24 09:55:18 hannken Exp $ */ +/* $NetBSD: union_vnops.c,v 1.70 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995 @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.69 2017/05/24 09:55:18 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: union_vnops.c,v 1.70 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -1577,12 +1577,14 @@ union_inactive(void *v) int union_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct vnode *uvp = UPPERVP(vp); + VOP_UNLOCK(vp); + if (uvp != NULL) { mutex_enter(uvp->v_interlock); KASSERT(vp->v_interlock == uvp->v_interlock); diff --git a/sys/fs/unionfs/unionfs_vnops.c b/sys/fs/unionfs/unionfs_vnops.c index 88691251690b..02c7e3eeff18 100644 --- a/sys/fs/unionfs/unionfs_vnops.c +++ b/sys/fs/unionfs/unionfs_vnops.c @@ -1478,10 +1478,12 @@ unionfs_inactive(void *v) static int unionfs_reclaim(void *v) { - struct vop_reclaim_args *ap = v; + struct vop_reclaim_v2_args *ap = v; /* UNIONFS_INTERNAL_DEBUG("unionfs_reclaim: enter\n"); */ + VOP_UNLOCK(ap->a_vp); + unionfs_noderem(ap->a_vp); /* UNIONFS_INTERNAL_DEBUG("unionfs_reclaim: leave\n"); */ diff --git a/sys/fs/v7fs/v7fs_vnops.c b/sys/fs/v7fs/v7fs_vnops.c index 85285e2dd950..2b5a9cbd2ae4 100644 --- a/sys/fs/v7fs/v7fs_vnops.c +++ b/sys/fs/v7fs/v7fs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: v7fs_vnops.c,v 1.25 2017/04/26 03:02:49 riastradh Exp $ */ +/* $NetBSD: v7fs_vnops.c,v 1.26 2017/05/26 14:21:01 riastradh Exp $ */ /*- * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.25 2017/04/26 03:02:49 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.26 2017/05/26 14:21:01 riastradh Exp $"); #if defined _KERNEL_OPT #include "opt_v7fs.h" #endif @@ -1032,7 +1032,7 @@ v7fs_reclaim(void *v) { /*This vnode is no longer referenced by kernel. */ extern struct pool v7fs_node_pool; - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *a = v; struct vnode *vp = a->a_vp; @@ -1040,6 +1040,8 @@ v7fs_reclaim(void *v) struct v7fs_self *fs = v7node->v7fsmount->core; struct v7fs_inode *inode = &v7node->inode; + VOP_UNLOCK(vp); + DPRINTF("%p #%d\n", vp, inode->inode_number); if (v7fs_inode_nlink(inode) == 0) { v7fs_datablock_size_change(fs, 0, inode); diff --git a/sys/kern/vfs_vnode.c b/sys/kern/vfs_vnode.c index ed2ecfd5ca88..2ceaf702ad48 100644 --- a/sys/kern/vfs_vnode.c +++ b/sys/kern/vfs_vnode.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnode.c,v 1.88 2017/05/17 12:46:14 hannken Exp $ */ +/* $NetBSD: vfs_vnode.c,v 1.89 2017/05/26 14:20:59 riastradh Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -156,7 +156,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.88 2017/05/17 12:46:14 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.89 2017/05/26 14:20:59 riastradh Exp $"); #include #include @@ -1573,7 +1573,6 @@ vcache_reclaim(vnode_t *vp) * Note that the VOP_INACTIVE will not unlock the vnode. */ VOP_INACTIVE(vp, &recycle); - VOP_UNLOCK(vp); if (VOP_RECLAIM(vp)) { vnpanic(vp, "%s: cannot reclaim", __func__); } diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index fee2a6d7cc5d..e5bc729ef5e8 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -1,4 +1,4 @@ -# $NetBSD: vnode_if.src,v 1.74 2017/04/26 03:02:49 riastradh Exp $ +# $NetBSD: vnode_if.src,v 1.75 2017/05/26 14:21:00 riastradh Exp $ # # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. @@ -395,11 +395,12 @@ vop_inactive { }; # -#% reclaim vp U U U +#% reclaim vp L U U # vop_reclaim { + VERSION 2 FSTRANS=NO - IN LOCKED=NO struct vnode *vp; + IN LOCKED=YES struct vnode *vp; }; # diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index 3279bc6a63de..84149237e63d 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdesc_vnops.c,v 1.128 2017/04/11 14:25:00 riastradh Exp $ */ +/* $NetBSD: fdesc_vnops.c,v 1.129 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.128 2017/04/11 14:25:00 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.129 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -855,12 +855,14 @@ fdesc_inactive(void *v) int fdesc_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct fdescnode *fd = VTOFDESC(vp); + VOP_UNLOCK(vp); + vp->v_data = NULL; kmem_free(fd, sizeof(struct fdescnode)); diff --git a/sys/miscfs/genfs/layer_vnops.c b/sys/miscfs/genfs/layer_vnops.c index f7c287108098..0a6dc4116964 100644 --- a/sys/miscfs/genfs/layer_vnops.c +++ b/sys/miscfs/genfs/layer_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: layer_vnops.c,v 1.65 2017/05/24 09:54:40 hannken Exp $ */ +/* $NetBSD: layer_vnops.c,v 1.66 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 1999 National Aeronautics & Space Administration @@ -170,7 +170,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.65 2017/05/24 09:54:40 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: layer_vnops.c,v 1.66 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -705,7 +705,7 @@ layer_revoke(void *v) int layer_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; struct lwp *a_l; } */ *ap = v; @@ -714,6 +714,8 @@ layer_reclaim(void *v) struct layer_node *xp = VTOLAYER(vp); struct vnode *lowervp = xp->layer_lowervp; + VOP_UNLOCK(vp); + /* * Note: in vop_reclaim, the node's struct lock has been * decomissioned, so we have to be careful about calling diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index fb5d09e35b04..e01918718aa8 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: kernfs_vnops.c,v 1.157 2017/04/11 14:25:01 riastradh Exp $ */ +/* $NetBSD: kernfs_vnops.c,v 1.158 2017/05/26 14:21:01 riastradh Exp $ */ /* * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.157 2017/04/11 14:25:01 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.158 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -1074,12 +1074,14 @@ kernfs_inactive(void *v) int kernfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct kernfs_node *kfs = VTOKERN(vp); + VOP_UNLOCK(vp); + vp->v_data = NULL; mutex_enter(&kfs_lock); TAILQ_REMOVE(&VFSTOKERNFS(vp->v_mount)->nodelist, kfs, kfs_list); diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c index 23122c63122e..4839252c041e 100644 --- a/sys/miscfs/procfs/procfs_vnops.c +++ b/sys/miscfs/procfs/procfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_vnops.c,v 1.196 2017/04/11 14:25:01 riastradh Exp $ */ +/* $NetBSD: procfs_vnops.c,v 1.197 2017/05/26 14:21:01 riastradh Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -105,7 +105,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.196 2017/04/11 14:25:01 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.197 2017/05/26 14:21:01 riastradh Exp $"); #include #include @@ -438,12 +438,14 @@ procfs_inactive(void *v) int procfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct pfsnode *pfs = VTOPFS(vp); + VOP_UNLOCK(vp); + /* * To interlock with procfs_revoke_vnodes(). */ diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 1387b3f47b29..e581cac6d151 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec_vnops.c,v 1.171 2017/04/12 06:43:56 martin Exp $ */ +/* $NetBSD: spec_vnops.c,v 1.172 2017/05/26 14:21:02 riastradh Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.171 2017/04/12 06:43:56 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.172 2017/05/26 14:21:02 riastradh Exp $"); #include #include @@ -1096,10 +1096,12 @@ spec_inactive(void *v) int spec_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; - struct vnode *vp __diagused = ap->a_vp; + struct vnode *vp = ap->a_vp; + + VOP_UNLOCK(vp); KASSERT(vp->v_mount == dead_rootmount); return 0; diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index ac631d15e31a..1f95222f1ed1 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_node.c,v 1.120 2017/04/11 14:25:01 riastradh Exp $ */ +/* $NetBSD: nfs_node.c,v 1.121 2017/05/26 14:21:02 riastradh Exp $ */ /* * Copyright (c) 1989, 1993 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_node.c,v 1.120 2017/04/11 14:25:01 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_node.c,v 1.121 2017/05/26 14:21:02 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_nfs.h" @@ -216,12 +216,14 @@ nfs_inactive(void *v) int nfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct nfsnode *np = VTONFS(vp); + VOP_UNLOCK(vp); + if (prtactive && vp->v_usecount > 1) vprint("nfs_reclaim: pushing active", vp); diff --git a/sys/rump/librump/rumpvfs/rumpfs.c b/sys/rump/librump/rumpvfs/rumpfs.c index 90b9d2876804..eb3c19d3bdb3 100644 --- a/sys/rump/librump/rumpvfs/rumpfs.c +++ b/sys/rump/librump/rumpvfs/rumpfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.148 2017/04/26 03:02:49 riastradh Exp $ */ +/* $NetBSD: rumpfs.c,v 1.149 2017/05/26 14:21:00 riastradh Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.148 2017/04/26 03:02:49 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.149 2017/05/26 14:21:00 riastradh Exp $"); #include #include @@ -1613,12 +1613,14 @@ rump_vop_inactive(void *v) static int rump_vop_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct rumpfs_node *rn = vp->v_data; + VOP_UNLOCK(vp); + mutex_enter(&reclock); rn->rn_vp = NULL; mutex_exit(&reclock); diff --git a/sys/ufs/chfs/chfs_vnops.c b/sys/ufs/chfs/chfs_vnops.c index 62e05ea938c2..aa1ace42aee9 100644 --- a/sys/ufs/chfs/chfs_vnops.c +++ b/sys/ufs/chfs/chfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: chfs_vnops.c,v 1.32 2017/04/26 03:02:49 riastradh Exp $ */ +/* $NetBSD: chfs_vnops.c,v 1.33 2017/05/26 14:21:02 riastradh Exp $ */ /*- * Copyright (c) 2010 Department of Software Engineering, @@ -1474,12 +1474,14 @@ chfs_inactive(void *v) int chfs_reclaim(void *v) { - struct vop_reclaim_args *ap = v; + struct vop_reclaim_v2_args *ap = v; struct vnode *vp = ap->a_vp; struct chfs_inode *ip = VTOI(vp); struct chfs_mount *chmp = ip->chmp; struct chfs_dirent *fd; + VOP_UNLOCK(vp); + mutex_enter(&chmp->chm_lock_mountfields); mutex_enter(&chmp->chm_lock_vnocache); diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index 246ae8508847..2047e4d81dfe 100644 --- a/sys/ufs/ext2fs/ext2fs_vnops.c +++ b/sys/ufs/ext2fs/ext2fs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_vnops.c,v 1.126 2017/04/26 03:02:49 riastradh Exp $ */ +/* $NetBSD: ext2fs_vnops.c,v 1.127 2017/05/26 14:21:02 riastradh Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.126 2017/04/26 03:02:49 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.127 2017/05/26 14:21:02 riastradh Exp $"); #include #include @@ -1123,13 +1123,15 @@ bad: int ext2fs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); int error; + VOP_UNLOCK(vp); + /* * The inode must be freed and updated before being removed * from its hash chain. Other threads trying to gain a hold diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 11e8e2b8b432..241e22bd412c 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vnops.c,v 1.128 2017/03/02 00:43:40 christos Exp $ */ +/* $NetBSD: ffs_vnops.c,v 1.129 2017/05/26 14:21:02 riastradh Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.128 2017/03/02 00:43:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.129 2017/05/26 14:21:02 riastradh Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -540,7 +540,7 @@ ffs_full_fsync(struct vnode *vp, int flags) int ffs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; struct lwp *a_l; } */ *ap = v; @@ -551,6 +551,8 @@ ffs_reclaim(void *v) void *data; int error; + VOP_UNLOCK(vp); + /* * The inode must be freed and updated before being removed * from its hash chain. Other threads trying to gain a hold diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index 60d4b8dea0bc..71c4d6b8a9e6 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vnops.c,v 1.314 2017/04/26 03:02:49 riastradh Exp $ */ +/* $NetBSD: lfs_vnops.c,v 1.315 2017/05/26 14:21:02 riastradh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.314 2017/04/26 03:02:49 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.315 2017/05/26 14:21:02 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1414,7 +1414,7 @@ lfsfifo_close(void *v) int lfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; @@ -1422,6 +1422,8 @@ lfs_reclaim(void *v) struct lfs *fs; int error; + VOP_UNLOCK(vp); + ip = VTOI(vp); fs = ip->i_lfs; diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index 4e5953bb085e..7cb75fe7a62a 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: mfs_vnops.c,v 1.57 2017/04/11 14:25:01 riastradh Exp $ */ +/* $NetBSD: mfs_vnops.c,v 1.58 2017/05/26 14:21:02 riastradh Exp $ */ /* * Copyright (c) 1989, 1993 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mfs_vnops.c,v 1.57 2017/04/11 14:25:01 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfs_vnops.c,v 1.58 2017/05/26 14:21:02 riastradh Exp $"); #include #include @@ -290,13 +290,15 @@ mfs_inactive(void *v) int mfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct mfsnode *mfsp = VTOMFS(vp); int refcnt; + VOP_UNLOCK(vp); + mutex_enter(&mfs_lock); vp->v_data = NULL; refcnt = --mfsp->mfs_refcnt;