aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 8cc941e5b3e1..5e7ea996f105 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1339,7 +1339,6 @@ fail:
1339static noinline int check_can_nocow(struct inode *inode, loff_t pos, 1339static noinline int check_can_nocow(struct inode *inode, loff_t pos,
1340 size_t *write_bytes) 1340 size_t *write_bytes)
1341{ 1341{
1342 struct btrfs_trans_handle *trans;
1343 struct btrfs_root *root = BTRFS_I(inode)->root; 1342 struct btrfs_root *root = BTRFS_I(inode)->root;
1344 struct btrfs_ordered_extent *ordered; 1343 struct btrfs_ordered_extent *ordered;
1345 u64 lockstart, lockend; 1344 u64 lockstart, lockend;
@@ -1361,16 +1360,8 @@ static noinline int check_can_nocow(struct inode *inode, loff_t pos,
1361 btrfs_put_ordered_extent(ordered); 1360 btrfs_put_ordered_extent(ordered);
1362 } 1361 }
1363 1362
1364 trans = btrfs_join_transaction(root);
1365 if (IS_ERR(trans)) {
1366 unlock_extent(&BTRFS_I(inode)->io_tree, lockstart, lockend);
1367 return PTR_ERR(trans);
1368 }
1369
1370 num_bytes = lockend - lockstart + 1; 1363 num_bytes = lockend - lockstart + 1;
1371 ret = can_nocow_extent(trans, inode, lockstart, &num_bytes, NULL, NULL, 1364 ret = can_nocow_extent(inode, lockstart, &num_bytes, NULL, NULL, NULL);
1372 NULL);
1373 btrfs_end_transaction(trans, root);
1374 if (ret <= 0) { 1365 if (ret <= 0) {
1375 ret = 0; 1366 ret = 0;
1376 } else { 1367 } else {