diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-16 23:09:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 20:48:00 -0400 |
commit | 10d9f309d88ca7f47133d57e99b72810f119f75b (patch) | |
tree | 9fb29dbfce5e040b2232bca2378e8de13fc13c31 /fs/btrfs | |
parent | 2fbe8c8ad176db69dfc682b4abb721c8fc19c3fd (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bcb20a9a3b93..2548a04a0230 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4766,11 +4766,10 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, | |||
4766 | if (err) { | 4766 | if (err) { |
4767 | drop_inode = 1; | 4767 | drop_inode = 1; |
4768 | } else { | 4768 | } else { |
4769 | struct dentry *parent = dget_parent(dentry); | 4769 | struct dentry *parent = dentry->d_parent; |
4770 | err = btrfs_update_inode(trans, root, inode); | 4770 | err = btrfs_update_inode(trans, root, inode); |
4771 | BUG_ON(err); | 4771 | BUG_ON(err); |
4772 | btrfs_log_new_name(trans, inode, NULL, parent); | 4772 | btrfs_log_new_name(trans, inode, NULL, parent); |
4773 | dput(parent); | ||
4774 | } | 4773 | } |
4775 | 4774 | ||
4776 | nr = trans->blocks_used; | 4775 | nr = trans->blocks_used; |
@@ -7062,9 +7061,8 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
7062 | BUG_ON(ret); | 7061 | BUG_ON(ret); |
7063 | 7062 | ||
7064 | if (old_ino != BTRFS_FIRST_FREE_OBJECTID) { | 7063 | if (old_ino != BTRFS_FIRST_FREE_OBJECTID) { |
7065 | struct dentry *parent = dget_parent(new_dentry); | 7064 | struct dentry *parent = new_dentry->d_parent; |
7066 | btrfs_log_new_name(trans, old_inode, old_dir, parent); | 7065 | btrfs_log_new_name(trans, old_inode, old_dir, parent); |
7067 | dput(parent); | ||
7068 | btrfs_end_log_trans(root); | 7066 | btrfs_end_log_trans(root); |
7069 | } | 7067 | } |
7070 | out_fail: | 7068 | out_fail: |