From 8abb7a62dcb1c30b05f071da3150d4cb07f5a04d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 28 May 2020 22:28:16 +0000 Subject: [PATCH] src/aiori-CEPHFS: Add sync Signed-off-by: Mark Nelson --- src/aiori-CEPHFS.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/aiori-CEPHFS.c b/src/aiori-CEPHFS.c index d5c6154..2c8d34b 100755 --- a/src/aiori-CEPHFS.c +++ b/src/aiori-CEPHFS.c @@ -76,6 +76,7 @@ static int CEPHFS_MkDir(const char *, mode_t, IOR_param_t *); static int CEPHFS_RmDir(const char *, IOR_param_t *); static int CEPHFS_Access(const char *, int, IOR_param_t *); static int CEPHFS_Stat(const char *, struct stat *, IOR_param_t *); +static void CEPHFS_Sync(IOR_param_t *); static option_help * CEPHFS_options(); /************************** D E C L A R A T I O N S ***************************/ @@ -97,6 +98,7 @@ ior_aiori_t cephfs_aiori = { .rmdir = CEPHFS_RmDir, .access = CEPHFS_Access, .stat = CEPHFS_Stat, + .sync = CEPHFS_Sync, .get_options = CEPHFS_options, }; @@ -359,3 +361,12 @@ static int CEPHFS_Stat(const char *testFileName, struct stat *buf, IOR_param_t * { return ceph_stat(cmount, pfix(testFileName), buf); } + +static void CEPHFS_Sync(IOR_param_t *param) +{ + int ret = ceph_sync_fs(cmount); + if (ret < 0) { + CEPHFS_ERR("ceph_sync_fs failed", ret); + } + +}