]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
mke2fs: Display progress report during the device discard
authorLukas Czerner <lczerner@redhat.com>
Mon, 24 Jan 2011 19:52:00 +0000 (20:52 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 21 Feb 2011 02:55:33 +0000 (21:55 -0500)
commit7d9e31655fca48e9d6c2647ad443124113508b73
tree228fb600ba0b95bcd7155791067d7bbba587ca8f
parent214580a339a18b0539b5998d3b47934956a30a1c
mke2fs: Display progress report during the device discard

For some time now we are doing initial discard of the device prior to
filesystem creation. However, there is no feedback for the user and
hence on some devices with slow TRIM implementation it may appear that
mke2fs is stuck.

This commit introduce new function mke2fs_discard_device(), which is a
wrapper for io_channel_discard(). The discard is done in chunks of
2GB, which seems reasonably well for both slow and fast devices, and
discard progress is reported back to the user.

I gave up on doing fancy things like align discard according to
discard_alignment, checking for discard granularity and computing
estimate time. First of all, because it would require either new ioctl
to retrieve those information or use of libudev library, none of it
seems to be worth it. Regarding discard_granularity, I doubt there is
any sane device with discard granularity that big it would affect this.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/mke2fs.c