Borrow a clue from the vmlocking branch, and consolidate all of
the vput(9)ing in tmpfs_rmdir() in one place. No functional change intended.
This commit is contained in:
parent
b0281cfdf3
commit
28f88dda1b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tmpfs_vnops.c,v 1.39 2007/07/23 15:41:01 jmmv Exp $ */
|
||||
/* $NetBSD: tmpfs_vnops.c,v 1.40 2007/10/23 19:49:01 dyoung Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
|
||||
|
@ -42,7 +42,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.39 2007/07/23 15:41:01 jmmv Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.40 2007/10/23 19:49:01 dyoung Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/dirent.h>
|
||||
|
@ -1024,6 +1024,7 @@ tmpfs_rmdir(void *v)
|
|||
tmp = VFS_TO_TMPFS(dvp->v_mount);
|
||||
dnode = VP_TO_TMPFS_DIR(dvp);
|
||||
node = VP_TO_TMPFS_DIR(vp);
|
||||
error = 0;
|
||||
|
||||
/* Directories with more than two entries ('.' and '..') cannot be
|
||||
* removed. */
|
||||
|
@ -1061,25 +1062,17 @@ tmpfs_rmdir(void *v)
|
|||
|
||||
/* Release the parent. */
|
||||
cache_purge(dvp); /* XXX Is this needed? */
|
||||
vput(dvp);
|
||||
|
||||
/* Free the directory entry we just deleted. Note that the node
|
||||
* referred by it will not be removed until the vnode is really
|
||||
* reclaimed. */
|
||||
tmpfs_free_dirent(tmp, de, true);
|
||||
|
||||
/* Release the deleted vnode (will destroy the node, notify
|
||||
* interested parties and clean it from the cache). */
|
||||
out:
|
||||
/* Release the nodes. */
|
||||
vput(dvp);
|
||||
vput(vp);
|
||||
|
||||
error = 0;
|
||||
|
||||
out:
|
||||
if (error != 0) {
|
||||
vput(dvp);
|
||||
vput(vp);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue