src/aiori-CEPHFS: Add sync

Signed-off-by: Mark Nelson <mnelson@redhat.com>
master
Mark Nelson 2020-05-28 22:28:16 +00:00
parent 153b7aa60f
commit 8abb7a62dc
1 changed files with 11 additions and 0 deletions

View File

@ -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);
}
}