You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
btrfs-progs: detect discard ability more correctly for btrfs_prepare_device()
Instead of relying on sysfs interface which had some regression
reporting the discard support, let btrfs_prepare_device() to use the
discard_range() result to determine if we need to output the "Performing
full device TRIM" message.
This is done by checking if the first discard succeeded or not.
If the first discard call succeeded, then we know the device support
discard and should output the message.
And to reduce the initial delay before outputting the message (old/lower
end disks may take a long time even discarding 1 GiB), reduce the initial
discard range to 1MiB.
By this it's more reliable to detect discard support for
btrfs_prepare_device() and we can get rid of discard_supported(), and
the timing of the meessage should still be pretty much the same as the
original one, just with a small unobservable delay.
Reviewed-by: Anand Jain <[email protected]>
Reported-by: Anand Jain <[email protected]>
Signed-off-by: Qu Wenruo <[email protected]>
0 commit comments