Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257398
b: refs/heads/master
c: 2fbe8c8
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 21, 2011
1 parent 4364359 commit 7434d77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02c24a82187d5a628c68edfe71ae60dc135cd178
refs/heads/master: 2fbe8c8ad176db69dfc682b4abb721c8fc19c3fd
16 changes: 4 additions & 12 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static noinline int create_subvol(struct btrfs_root *root,
struct btrfs_inode_item *inode_item;
struct extent_buffer *leaf;
struct btrfs_root *new_root;
struct dentry *parent = dget_parent(dentry);
struct dentry *parent = dentry->d_parent;
struct inode *dir;
int ret;
int err;
Expand All @@ -332,10 +332,8 @@ static noinline int create_subvol(struct btrfs_root *root,
u64 index = 0;

ret = btrfs_find_free_objectid(root->fs_info->tree_root, &objectid);
if (ret) {
dput(parent);
if (ret)
return ret;
}

dir = parent->d_inode;

Expand All @@ -346,10 +344,8 @@ static noinline int create_subvol(struct btrfs_root *root,
* 2 - dir items
*/
trans = btrfs_start_transaction(root, 6);
if (IS_ERR(trans)) {
dput(parent);
if (IS_ERR(trans))
return PTR_ERR(trans);
}

leaf = btrfs_alloc_free_block(trans, root, root->leafsize,
0, objectid, NULL, 0, 0, 0);
Expand Down Expand Up @@ -439,7 +435,6 @@ static noinline int create_subvol(struct btrfs_root *root,

d_instantiate(dentry, btrfs_lookup_dentry(dir, dentry));
fail:
dput(parent);
if (async_transid) {
*async_transid = trans->transid;
err = btrfs_commit_transaction_async(trans, root, 1);
Expand All @@ -456,7 +451,6 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
bool readonly)
{
struct inode *inode;
struct dentry *parent;
struct btrfs_pending_snapshot *pending_snapshot;
struct btrfs_trans_handle *trans;
int ret;
Expand Down Expand Up @@ -504,9 +498,7 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
if (ret)
goto fail;

parent = dget_parent(dentry);
inode = btrfs_lookup_dentry(parent->d_inode, dentry);
dput(parent);
inode = btrfs_lookup_dentry(dentry->d_parent->d_inode, dentry);
if (IS_ERR(inode)) {
ret = PTR_ERR(inode);
goto fail;
Expand Down

0 comments on commit 7434d77

Please sign in to comment.