mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 01:59:54 +00:00
configure: add check for fallocate
We need to check for fallocate() rather than just linux/falloc.h + FALLOC_FL_PUNCH_HOLE since in uClibc we've got both but still not fallocate() itself since it's only implemented in newer unreleased versions. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
5792951de2
commit
3c160e7d11
@ -68,6 +68,7 @@ AC_TYPE_SIZE_T
|
||||
# Checks for library functions.
|
||||
AC_FUNC_GETMNTENT
|
||||
AC_CHECK_FUNCS_ONCE([
|
||||
fallocate
|
||||
getmntent
|
||||
memset
|
||||
])
|
||||
|
@ -46,7 +46,7 @@ int f2fs_trim_device()
|
||||
#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
|
||||
MSG(0, "Info: Discarding device\n");
|
||||
if (S_ISREG(stat_buf.st_mode)) {
|
||||
#ifdef FALLOC_FL_PUNCH_HOLE
|
||||
#if defined(HAVE_FALLOCATE) && defined(FALLOC_FL_PUNCH_HOLE)
|
||||
if (fallocate(config.fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
|
||||
range[0], range[1]) < 0) {
|
||||
MSG(0, "Info: fallocate(PUNCH_HOLE|KEEP_SIZE) is failed\n");
|
||||
|
Loading…
Reference in New Issue
Block a user