diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-09-20 01:51:59 -0600 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-09 09:15:38 -0400 |
commit | a698d0755adb6f27289d1e6610b2240595d27e8c (patch) | |
tree | bf54f9bcd6941a459be5aeaf22299547c693c0aa /fs/btrfs/inode.c | |
parent | e8830e606ffee383f073e32313f11fc5692813fe (diff) | |
download | lwn-a698d0755adb6f27289d1e6610b2240595d27e8c.tar.gz lwn-a698d0755adb6f27289d1e6610b2240595d27e8c.zip |
Btrfs: add a type field for the transaction handle
This patch add a type field into the transaction handle structure,
in this way, we needn't implement various end-transaction functions
and can make the code more simple and readable.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 596305e4d75b..e355eb0aea1e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1363,11 +1363,7 @@ out_check: } error: - if (nolock) { - err = btrfs_end_transaction_nolock(trans, root); - } else { - err = btrfs_end_transaction(trans, root); - } + err = btrfs_end_transaction(trans, root); if (!ret) ret = err; @@ -1957,12 +1953,8 @@ out_unlock: out: if (root != root->fs_info->tree_root) btrfs_delalloc_release_metadata(inode, ordered_extent->len); - if (trans) { - if (nolock) - btrfs_end_transaction_nolock(trans, root); - else - btrfs_end_transaction(trans, root); - } + if (trans) + btrfs_end_transaction(trans, root); if (ret) clear_extent_uptodate(io_tree, ordered_extent->file_offset, @@ -4524,10 +4516,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc) trans = btrfs_join_transaction(root); if (IS_ERR(trans)) return PTR_ERR(trans); - if (nolock) - ret = btrfs_end_transaction_nolock(trans, root); - else - ret = btrfs_commit_transaction(trans, root); + ret = btrfs_commit_transaction(trans, root); } return ret; } |