Module Name: src Committed By: hannken Date: Fri Jul 9 08:16:28 UTC 2010
Modified Files: src/sys/fs/smbfs: smbfs_node.c smbfs_vfsops.c Log Message: Replace vget() with vref()/vn_lock(), this node already has a reference. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/fs/smbfs/smbfs_node.c cvs rdiff -u -r1.91 -r1.92 src/sys/fs/smbfs/smbfs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/smbfs/smbfs_node.c diff -u src/sys/fs/smbfs/smbfs_node.c:1.43 src/sys/fs/smbfs/smbfs_node.c:1.44 --- src/sys/fs/smbfs/smbfs_node.c:1.43 Thu Jun 24 13:03:10 2010 +++ src/sys/fs/smbfs/smbfs_node.c Fri Jul 9 08:16:28 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_node.c,v 1.43 2010/06/24 13:03:10 hannken Exp $ */ +/* $NetBSD: smbfs_node.c,v 1.44 2010/07/09 08:16:28 hannken Exp $ */ /* * Copyright (c) 2000-2001 Boris Popov @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.43 2010/06/24 13:03:10 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_node.c,v 1.44 2010/07/09 08:16:28 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -112,8 +112,11 @@ if (dvp == NULL) return EINVAL; vp = VTOSMB(VTOSMB(dvp)->n_parent)->n_vnode; - if ((error = vget(vp, LK_EXCLUSIVE | LK_RETRY)) == 0) + vref(vp); + if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) == 0) *vpp = vp; + else + vrele(vp); return (error); } Index: src/sys/fs/smbfs/smbfs_vfsops.c diff -u src/sys/fs/smbfs/smbfs_vfsops.c:1.91 src/sys/fs/smbfs/smbfs_vfsops.c:1.92 --- src/sys/fs/smbfs/smbfs_vfsops.c:1.91 Thu Jun 24 13:03:10 2010 +++ src/sys/fs/smbfs/smbfs_vfsops.c Fri Jul 9 08:16:28 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_vfsops.c,v 1.91 2010/06/24 13:03:10 hannken Exp $ */ +/* $NetBSD: smbfs_vfsops.c,v 1.92 2010/07/09 08:16:28 hannken Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.91 2010/06/24 13:03:10 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.92 2010/07/09 08:16:28 hannken Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -322,9 +322,10 @@ smbfs_root(struct mount *mp, struct vnode **vpp) { struct smbmount *smp = VFSTOSMBFS(mp); + int error; if (__predict_false(!smp->sm_root)) { - int error = smbfs_setroot(mp); + error = smbfs_setroot(mp); if (error) return (error); /* fallthrough */ @@ -332,7 +333,11 @@ KASSERT(smp->sm_root != NULL && SMBTOV(smp->sm_root) != NULL); *vpp = SMBTOV(smp->sm_root); - return vget(*vpp, LK_EXCLUSIVE | LK_RETRY); + vref(*vpp); + error = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + if (error) + vrele(*vpp); + return error; } /*