From 86c35b90b77323913c46c2542f163e5102676b8c Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 2 Apr 2010 14:03:01 +0000 Subject: Add function vop_rename_fail(9) that performs needed cleanup for locks and references of the VOP_RENAME(9) arguments. Use vop_rename_fail() in deadfs_rename(). Tested by: Mikolaj Golub MFC after: 1 week --- sys/kern/vfs_subr.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sys/kern') diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index daaa5b1..9d4b3a9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3751,6 +3751,20 @@ assert_vop_slocked(struct vnode *vp, const char *str) #endif /* DEBUG_VFS_LOCKS */ void +vop_rename_fail(struct vop_rename_args *ap) +{ + + if (ap->a_tvp != NULL) + vput(ap->a_tvp); + if (ap->a_tdvp == ap->a_tvp) + vrele(ap->a_tdvp); + else + vput(ap->a_tdvp); + vrele(ap->a_fdvp); + vrele(ap->a_fvp); +} + +void vop_rename_pre(void *ap) { struct vop_rename_args *a = ap; -- cgit v1.1