syncfs has been supported since Linux 2.6.39.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
AC_HAVE_PWRITEV2
AC_HAVE_PREADV
AC_HAVE_COPY_FILE_RANGE
-AC_HAVE_SYNCFS
AC_HAVE_FSETXATTR
AC_HAVE_MREMAP
AC_NEED_INTERNAL_FSXATTR
HAVE_PREADV = @have_preadv@
HAVE_PWRITEV2 = @have_pwritev2@
HAVE_COPY_FILE_RANGE = @have_copy_file_range@
-HAVE_SYNCFS = @have_syncfs@
HAVE_FSETXATTR = @have_fsetxattr@
HAVE_MREMAP = @have_mremap@
NEED_INTERNAL_FSXATTR = @need_internal_fsxattr@
LCFLAGS += -DHAVE_COPY_FILE_RANGE
endif
-ifeq ($(HAVE_SYNCFS),yes)
-LCFLAGS += -DHAVE_SYNCFS
-endif
-
ifeq ($(ENABLE_EDITLINE),yes)
LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
endif
return 0;
}
-#ifdef HAVE_SYNCFS
static cmdinfo_t syncfs_cmd;
static int
}
return 0;
}
-#endif
void
sync_init(void)
add_command(&sync_cmd);
-#ifdef HAVE_SYNCFS
syncfs_cmd.name = "syncfs";
syncfs_cmd.cfunc = syncfs_f;
syncfs_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK;
_("calls syncfs(2) to flush all in-core filesystem state to disk");
add_command(&syncfs_cmd);
-#endif
}
AC_SUBST(have_copy_file_range)
])
-#
-# Check if we have a syncfs libc call (Linux)
-#
-AC_DEFUN([AC_HAVE_SYNCFS],
- [ AC_MSG_CHECKING([for syncfs])
- AC_LINK_IFELSE(
- [ AC_LANG_PROGRAM([[
-#define _GNU_SOURCE
-#include <unistd.h>
- ]], [[
-syncfs(0);
- ]])
- ], have_syncfs=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
- AC_SUBST(have_syncfs)
- ])
-
#
# Check if we have a fsetxattr call
#
LCFLAGS += -DHAVE_MALLINFO2
endif
-ifeq ($(HAVE_SYNCFS),yes)
-LCFLAGS += -DHAVE_SYNCFS
-endif
-
ifeq ($(HAVE_LIBATTR),yes)
LCFLAGS += -DHAVE_LIBATTR
endif
unsigned int scrub_nproc(struct scrub_ctx *ctx);
unsigned int scrub_nproc_workqueue(struct scrub_ctx *ctx);
-#ifndef HAVE_SYNCFS
-static inline int syncfs(int fd)
-{
- sync();
- return 0;
-}
-#endif
-
void background_sleep(void);
char *string_escape(const char *in);