diff options
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: | |||
| 1363 | } | 1363 | } |
| 1364 | 1364 | ||
| 1365 | error: | 1365 | error: |
| 1366 | if (nolock) { | 1366 | err = btrfs_end_transaction(trans, root); |
| 1367 | err = btrfs_end_transaction_nolock(trans, root); | ||
| 1368 | } else { | ||
| 1369 | err = btrfs_end_transaction(trans, root); | ||
| 1370 | } | ||
| 1371 | if (!ret) | 1367 | if (!ret) |
| 1372 | ret = err; | 1368 | ret = err; |
| 1373 | 1369 | ||
| @@ -1957,12 +1953,8 @@ out_unlock: | |||
| 1957 | out: | 1953 | out: |
| 1958 | if (root != root->fs_info->tree_root) | 1954 | if (root != root->fs_info->tree_root) |
| 1959 | btrfs_delalloc_release_metadata(inode, ordered_extent->len); | 1955 | btrfs_delalloc_release_metadata(inode, ordered_extent->len); |
| 1960 | if (trans) { | 1956 | if (trans) |
| 1961 | if (nolock) | 1957 | btrfs_end_transaction(trans, root); |
| 1962 | btrfs_end_transaction_nolock(trans, root); | ||
| 1963 | else | ||
| 1964 | btrfs_end_transaction(trans, root); | ||
| 1965 | } | ||
| 1966 | 1958 | ||
| 1967 | if (ret) | 1959 | if (ret) |
| 1968 | clear_extent_uptodate(io_tree, ordered_extent->file_offset, | 1960 | clear_extent_uptodate(io_tree, ordered_extent->file_offset, |
| @@ -4524,10 +4516,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
| 4524 | trans = btrfs_join_transaction(root); | 4516 | trans = btrfs_join_transaction(root); |
| 4525 | if (IS_ERR(trans)) | 4517 | if (IS_ERR(trans)) |
| 4526 | return PTR_ERR(trans); | 4518 | return PTR_ERR(trans); |
| 4527 | if (nolock) | 4519 | ret = btrfs_commit_transaction(trans, root); |
| 4528 | ret = btrfs_end_transaction_nolock(trans, root); | ||
| 4529 | else | ||
| 4530 | ret = btrfs_commit_transaction(trans, root); | ||
| 4531 | } | 4520 | } |
| 4532 | return ret; | 4521 | return ret; |
| 4533 | } | 4522 | } |
