31 lines
986 B
Diff
31 lines
986 B
Diff
|
From f7025683c14debd0ca3ee21dc64699a185849b35 Mon Sep 17 00:00:00 2001
|
||
|
From: Rakesh Pandit <rakesh@tuxera.com>
|
||
|
Date: Tue, 22 Apr 2014 16:30:27 +0300
|
||
|
Subject: [PATCH 03/42] 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 <rakesh@tuxera.com>
|
||
|
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||
|
---
|
||
|
utils.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/utils.c b/utils.c
|
||
|
index 3e9c527a492c..187ad3b9b12b 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);
|
||
|
--
|
||
|
1.9.0
|
||
|
|