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
This commit is contained in:
parent
c86819ec59
commit
ea01588095
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=206093
@ -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);
|
||||
}
|
||||
|
@ -3750,6 +3750,20 @@ assert_vop_slocked(struct vnode *vp, const char *str)
|
||||
#endif /* 0 */
|
||||
#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)
|
||||
{
|
||||
|
@ -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; \
|
||||
|
Loading…
Reference in New Issue
Block a user