From: Rakesh Pandit Date: Tue, 22 Apr 2014 13:30:27 +0000 (+0300) Subject: Btrfs-progs: fix check to test trim support X-Git-Tag: upstream/4.16.1~2858 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=726bc372b9529a11c79dea75f2bcc8ef8a34d67a;p=platform%2Fupstream%2Fbtrfs-progs.git Btrfs-progs: fix check to test trim support It was added in 25d82d22 but broke recently in 4724d7b0 while making discard interruptible. Signed-off-by: Rakesh Pandit Signed-off-by: David Sterba --- diff --git a/utils.c b/utils.c index 3e9c527..187ad3b 100644 --- a/utils.c +++ b/utils.c @@ -626,7 +626,7 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret, * is not necessary for the mkfs functionality but just an * optimization. */ - if (discard_blocks(fd, 0, 0) == 0) { + if (discard_range(fd, 0, 0) == 0) { fprintf(stderr, "Performing full device TRIM (%s) ...\n", pretty_size(block_count)); discard_blocks(fd, 0, block_count);