svn commit: r206413 - in stable/8/sys: fs/deadfs kern sys
Konstantin Belousov
kib at FreeBSD.org
Fri Apr 9 08:39:29 UTC 2010
Author: kib
Date: Fri Apr 9 08:39:28 2010
New Revision: 206413
URL: http://svn.freebsd.org/changeset/base/206413
Log:
MFC r206093:
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().
Modified:
stable/8/sys/fs/deadfs/dead_vnops.c
stable/8/sys/kern/vfs_subr.c
stable/8/sys/sys/vnode.h
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/fs/deadfs/dead_vnops.c
==============================================================================
--- stable/8/sys/fs/deadfs/dead_vnops.c Fri Apr 9 08:20:43 2010 (r206412)
+++ stable/8/sys/fs/deadfs/dead_vnops.c Fri Apr 9 08:39:28 2010 (r206413)
@@ -225,13 +225,7 @@ dead_rename(ap)
struct componentname *a_tcnp;
} */ *ap;
{
- if (ap->a_tvp)
- 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);
+
+ vop_rename_fail(ap);
return (EXDEV);
}
Modified: stable/8/sys/kern/vfs_subr.c
==============================================================================
--- stable/8/sys/kern/vfs_subr.c Fri Apr 9 08:20:43 2010 (r206412)
+++ stable/8/sys/kern/vfs_subr.c Fri Apr 9 08:39:28 2010 (r206413)
@@ -3749,6 +3749,20 @@ assert_vop_slocked(struct vnode *vp, con
#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;
Modified: stable/8/sys/sys/vnode.h
==============================================================================
--- stable/8/sys/sys/vnode.h Fri Apr 9 08:20:43 2010 (r206412)
+++ stable/8/sys/sys/vnode.h Fri Apr 9 08:39:28 2010 (r206413)
@@ -720,6 +720,8 @@ void vop_symlink_post(void *a, int rc);
void vop_unlock_post(void *a, int rc);
void vop_unlock_pre(void *a);
+void vop_rename_fail(struct vop_rename_args *ap);
+
#define VOP_WRITE_PRE(ap) \
struct vattr va; \
int error, osize, ooffset, noffset; \
More information about the svn-src-stable-8
mailing list