Whamcloud - gitweb
e2fsprogs: Add discard function into struct_io_manager
authorLukas Czerner <lczerner@redhat.com>
Thu, 18 Nov 2010 03:38:36 +0000 (03:38 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 23 Nov 2010 01:41:00 +0000 (20:41 -0500)
commite90a59ed434d6c5e38dd148aa4ba5b22b8f7eb24
tree3b9af41b7a4ba5ce130def5b4809dda82739d44a
parent4fca2b9c07981abca16d337b2e57f78569cbbe05
e2fsprogs: Add discard function into struct_io_manager

In order to provide generic "discard" function for all e2fsprogs tools
add a discard function prototype into struct_io_manager. Specific
function for specific io managers can be crated that way.

This commit also creates unix_discard function which uses BLKDISCARD
ioctl to discard data blocks on the block device and bind it into
unit_io_manager structure to be available for all e2fsprogs tools.
Note that BLKDISCARD is still Linux specific ioctl, however other
unix systems may provide similar functionality. So far the
unix_discard() remains linux specific hence is embedded in #ifdef
__linux__ macro.

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