Whamcloud - gitweb
ext2fs: don't retry discard/zeroout repeatedly 94/51294/3
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 10 May 2023 04:26:39 +0000 (22:26 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 7 Aug 2023 14:08:39 +0000 (14:08 +0000)
commit9cd756fb8c83d389662dc0c3a9ea8fece949b196
treee05251e2ae77bc6815e572fbb272006ca5824aff
parent165abd0095613b60fbf64d139b899ba4896a2d92
ext2fs: don't retry discard/zeroout repeatedly

Call safe_getenv(UNIX_IO_NOZEROOUT) once when the device is
opened and set CHANNEL_FLAG_NOZEROOUT if present instead of
getting uid/euid/getenv every time unix_zeroout() is called.

For unix_discard() and unix_zeroout() don't continue to call
them if the block device doesn't support these operations.

Change-Id: I3b3b79cf49a6f1cf9b254eb32103f174bacdfbd2
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/tools/e2fsprogs/+/51294
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lib/ext2fs/ext2_io.h
lib/ext2fs/unix_io.c