mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 15:31:14 +07:00
get rid of useless dget_parent() in btrfs rename() and link()
->d_parent is locked and stable there... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
2fbe8c8ad1
commit
10d9f309d8
@ -4766,11 +4766,10 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
|
|||||||
if (err) {
|
if (err) {
|
||||||
drop_inode = 1;
|
drop_inode = 1;
|
||||||
} else {
|
} else {
|
||||||
struct dentry *parent = dget_parent(dentry);
|
struct dentry *parent = dentry->d_parent;
|
||||||
err = btrfs_update_inode(trans, root, inode);
|
err = btrfs_update_inode(trans, root, inode);
|
||||||
BUG_ON(err);
|
BUG_ON(err);
|
||||||
btrfs_log_new_name(trans, inode, NULL, parent);
|
btrfs_log_new_name(trans, inode, NULL, parent);
|
||||||
dput(parent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nr = trans->blocks_used;
|
nr = trans->blocks_used;
|
||||||
@ -7062,9 +7061,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|||||||
BUG_ON(ret);
|
BUG_ON(ret);
|
||||||
|
|
||||||
if (old_ino != BTRFS_FIRST_FREE_OBJECTID) {
|
if (old_ino != BTRFS_FIRST_FREE_OBJECTID) {
|
||||||
struct dentry *parent = dget_parent(new_dentry);
|
struct dentry *parent = new_dentry->d_parent;
|
||||||
btrfs_log_new_name(trans, old_inode, old_dir, parent);
|
btrfs_log_new_name(trans, old_inode, old_dir, parent);
|
||||||
dput(parent);
|
|
||||||
btrfs_end_log_trans(root);
|
btrfs_end_log_trans(root);
|
||||||
}
|
}
|
||||||
out_fail:
|
out_fail:
|
||||||
|
Loading…
Reference in New Issue
Block a user