summary refs log tree commit diff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2020-04-21 11:25:31 +0100
committerDavid Sterba <dsterba@suse.com>2020-05-25 11:25:27 +0200
commit0bc2d3c08e2b970117cc2b7c529291123978cae6 (patch)
treeeb68e46eb78d3bbf61f5cd778ca61607e6d17a0e
parent77d5d6893106ea7b19709bed2491f93ff10a86d7 (diff)
downloadlinux-0bc2d3c08e2b970117cc2b7c529291123978cae6.tar.gz
btrfs: remove useless check for copy_items() return value
At btrfs_log_prealloc_extents() we are checking if copy_items() returns a
value greater than 0. That used to happen in the past to signal the caller
that the path given to it was released and reused for other searches, but
as of commit 0e56315ca147b3 ("Btrfs: fix missing hole after hole punching
and fsync when using NO_HOLES"), the copy_items() function does not have
that behaviour anymore and always returns 0 or a negative value. So just
remove that check at btrfs_log_prealloc_extents(), which the previously
mentioned commit forgot to remove.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/tree-log.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 0254e8d10e4a..39ec25518ec2 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4335,12 +4335,9 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans,
 			}
 		}
 	}
-	if (ins_nr > 0) {
+	if (ins_nr > 0)
 		ret = copy_items(trans, inode, dst_path, path,
 				 start_slot, ins_nr, 1, 0);
-		if (ret > 0)
-			ret = 0;
-	}
 out:
 	btrfs_release_path(path);
 	btrfs_free_path(dst_path);