diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2014-04-01 11:08:42 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2014-04-01 11:08:42 -0400 |
commit | de22a4c3720a96f1c2ebf12b0857b6db6a991f2c (patch) | |
tree | 416887bb4a8755957f88d0cf9de563e45a78a1f4 /fs/namei.c | |
parent | 44b1d53043c482225196e8a9cd9f35163a1b3336 (diff) |
vfs: rename: move d_move() up
Move the d_move() in vfs_rename_dir() up, similarly to how it's done in
vfs_rename_other(). The next patch will consolidate these two functions
and this is the only structural difference between them.
I'm not sure if doing the d_move() after the dput is even valid. But there
may be a logical explanation for that. But moving the d_move() before the
dput() (and the mutex_unlock()) should definitely not hurt.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reviewed-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c index e987ea7c305f..2e86d2c4ec8a 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -4045,13 +4045,12 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, | |||
4045 | target->i_flags |= S_DEAD; | 4045 | target->i_flags |= S_DEAD; |
4046 | dont_mount(new_dentry); | 4046 | dont_mount(new_dentry); |
4047 | } | 4047 | } |
4048 | if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) | ||
4049 | d_move(old_dentry, new_dentry); | ||
4048 | out: | 4050 | out: |
4049 | if (target) | 4051 | if (target) |
4050 | mutex_unlock(&target->i_mutex); | 4052 | mutex_unlock(&target->i_mutex); |
4051 | dput(new_dentry); | 4053 | dput(new_dentry); |
4052 | if (!error) | ||
4053 | if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) | ||
4054 | d_move(old_dentry,new_dentry); | ||
4055 | return error; | 4054 | return error; |
4056 | } | 4055 | } |
4057 | 4056 | ||