From 9f0beedd556daabd2ef48e05ead3fdab68598d2a Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Mon, 22 Jun 2020 16:43:26 +0300 Subject: storage/posix, libglusterfs: library function to sync filesystem Convert an ad-hoc hack to a regular library function gf_syncfs(). Signed-off-by: Dmitry Antipov Change-Id: I3ed93e9f28f22c273df1466ba4a458eacb8df395 Fixes: #1329 --- xlators/storage/posix/src/posix-helpers.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 73443a6a2e5..7f69afedf1f 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2395,23 +2395,8 @@ posix_fsyncer_syncfs(xlator_t *this, struct list_head *head) stub = list_entry(head->prev, call_stub_t, list); ret = posix_fd_ctx_get(stub->args.fd, this, &pfd, NULL); - if (ret) - return; - -#ifdef GF_LINUX_HOST_OS - /* syncfs() is not "declared" in RHEL's glibc even though - the kernel has support. - */ -#include -#include -#ifdef SYS_syncfs - syscall(SYS_syncfs, pfd->fd); -#else - sync(); -#endif -#else - sync(); -#endif + if (!ret) + (void)gf_syncfs(pfd->fd); } void * -- cgit