From c6abf85378ede3c3fd61363fc7166909b7d2251f Mon Sep 17 00:00:00 2001 From: Jean-Yves VET Date: Mon, 11 Feb 2019 14:42:30 +0100 Subject: [PATCH] aiori-IME: Add support of statfs in IME backend This patch adds the support of statfs in the IME backend. It uses ime_native_statvfs call to fill the ior_aiori_statfs_t structure. --- src/aiori-IME.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/aiori-IME.c b/src/aiori-IME.c index 107b321..95c48f2 100755 --- a/src/aiori-IME.c +++ b/src/aiori-IME.c @@ -269,20 +269,35 @@ static char *IME_GetVersion() return ver; } -/* - * XXX: statfs call is currently not exposed by IME native interface. - */ static int IME_StatFS(const char *path, ior_aiori_statfs_t *stat_buf, IOR_param_t *param) { + (void)param; + +#if (IME_NATIVE_API_VERSION >= 130) + struct statvfs statfs_buf; + + int ret = ime_native_statvfs(path, &statfs_buf); + if (ret) + return ret; + + stat_buf->f_bsize = statfs_buf.f_bsize; + stat_buf->f_blocks = statfs_buf.f_blocks; + stat_buf->f_bfree = statfs_buf.f_bfree; + stat_buf->f_files = statfs_buf.f_files; + stat_buf->f_ffree = statfs_buf.f_ffree; + + return 0; +#else (void)path; (void)stat_buf; - (void)param; WARN("statfs is currently not supported in IME backend!"); return -1; +#endif } + static int IME_MkDir(const char *path, mode_t mode, IOR_param_t *param) { (void)param;