]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
libext2fs: try to always use PUNCH_HOLE for unix_discard
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 28 Aug 2018 23:38:07 +0000 (16:38 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Sep 2018 15:56:11 +0000 (11:56 -0400)
commitbcca9876a3428c10417c660b78933e6e70e8a5f5
treeb8e3189628317d33e661c8835a7fc20e331cb006
parent3f6a9786d749e40952c233e6d1d324045d67416c
libext2fs: try to always use PUNCH_HOLE for unix_discard

Now that block devices support PUNCH_HOLE via fallocate, refactor the
unix_discard code into a helper that will always try to use it.  For
block devices we can fall back to BLKDISCARD, but we prefer to use
fallocate because it will always invalidate the page cache of the zeroed
region.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/unix_io.c