Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/smbfs - Remove redundant vput() before vgone().
details: https://anonhg.NetBSD.org/src/rev/8e0da3cd32bc
branches: trunk
changeset: 782966:8e0da3cd32bc
user: nakayama <nakayama%NetBSD.org@localhost>
date: Thu Nov 29 11:58:49 2012 +0000
description:
- Remove redundant vput() before vgone().
- Avoid unnecessary mutex_exit() in smbfs_node_alloc().
- Set NGONE bit to from-name vnode to invalidate the smbnode cache.
diffstat:
sys/fs/smbfs/smbfs_node.c | 9 +++++----
sys/fs/smbfs/smbfs_vnops.c | 11 +++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diffs (77 lines):
diff -r a42b85ee11de -r 8e0da3cd32bc sys/fs/smbfs/smbfs_node.c
--- a/sys/fs/smbfs/smbfs_node.c Thu Nov 29 11:34:33 2012 +0000
+++ b/sys/fs/smbfs/smbfs_node.c Thu Nov 29 11:58:49 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_node.c,v 1.48 2012/11/28 13:34:24 nakayama Exp $ */
+/* $NetBSD: smbfs_node.c,v 1.49 2012/11/29 11:58:49 nakayama Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.48 2012/11/28 13:34:24 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.49 2012/11/29 11:58:49 nakayama Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -150,15 +150,16 @@
*/
if ((vp->v_type == VDIR && (np->n_dosattr & SMB_FA_DIR) == 0) ||
(vp->v_type == VREG && (np->n_dosattr & SMB_FA_DIR) != 0)) {
- vput(vp);
+ VOP_UNLOCK(vp);
vgone(vp);
- break;
+ goto allocnew;
}
*vpp = vp;
return (0);
}
mutex_exit(&smp->sm_hashlock);
+allocnew:
/*
* If we don't have node attributes, then it is an explicit lookup
* for an existing vnode.
diff -r a42b85ee11de -r 8e0da3cd32bc sys/fs/smbfs/smbfs_vnops.c
--- a/sys/fs/smbfs/smbfs_vnops.c Thu Nov 29 11:34:33 2012 +0000
+++ b/sys/fs/smbfs/smbfs_vnops.c Thu Nov 29 11:58:49 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_vnops.c,v 1.83 2012/11/28 13:34:24 nakayama Exp $ */
+/* $NetBSD: smbfs_vnops.c,v 1.84 2012/11/29 11:58:49 nakayama Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.83 2012/11/28 13:34:24 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.84 2012/11/29 11:58:49 nakayama Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -725,6 +725,7 @@
}
error = smbfs_smb_rename(VTOSMB(fvp), VTOSMB(tdvp),
tcnp->cn_nameptr, tcnp->cn_namelen, &scred);
+ VTOSMB(fvp)->n_flag |= NGONE;
VN_KNOTE(fdvp, NOTE_WRITE);
VN_KNOTE(fvp, NOTE_RENAME);
}
@@ -1270,9 +1271,11 @@
cache_purge(newvp);
if (newvp != dvp) {
- vput(newvp);
- if (killit)
+ if (killit) {
+ VOP_UNLOCK(newvp);
vgone(newvp);
+ } else
+ vput(newvp);
} else
vrele(newvp);
*vpp = NULLVP;
Home |
Main Index |
Thread Index |
Old Index