Whamcloud - gitweb
e2fsprogs: Add CHANNEL_FLAGS_DISCARD_ZEROES flag for io_manager
authorLukas Czerner <lczerner@redhat.com>
Thu, 18 Nov 2010 03:38:37 +0000 (03:38 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 23 Nov 2010 01:41:46 +0000 (20:41 -0500)
commitd866599ab4955858b1541f0891b1b165ba66493a
tree8044870624bd8bc18a6ac26a3abef8f7064a0343
parente90a59ed434d6c5e38dd148aa4ba5b22b8f7eb24
e2fsprogs: Add CHANNEL_FLAGS_DISCARD_ZEROES flag for io_manager

When the device have discard support and simultaneously discard zeroes
data (and it is properly advertised), then we can take advantage of such
behavior in several e2fsprogs tools.

Add new flag CHANNEL_FLAGS_DISCARD_ZEROES for struct_io_channel so
each io_manager can take advantage of this. The flag is properly set
according to BLKDISCARDZEROES ioctl in unix_open.

Also remove old mke2fs_discard_zeroes_data() function and substitute it
with helper which test this flag.

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