From e6bd9ad3b31acf04372b1d442a753260caacfac8 Mon Sep 17 00:00:00 2001 From: Sylvain Didelot Date: Tue, 9 Oct 2018 12:14:30 +0200 Subject: [PATCH 1/2] common: call mkdir/access syscalls defined in backends mkdir/access syscalls used in PrependDir() should call their equivalent implemented by the backend. --- src/ior.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ior.c b/src/ior.c index 66cca76..bf5faa7 100755 --- a/src/ior.c +++ b/src/ior.c @@ -823,14 +823,15 @@ static char *PrependDir(IOR_param_t * test, char *rootDir) sprintf(dir, "%s%d", dir, (rank + rankOffset) % test->numTasks); /* dir doesn't exist, so create */ - if (access(dir, F_OK) != 0) { - if (mkdir(dir, S_IRWXU) < 0) { + if (backend->access(dir, F_OK, test) != 0) { + if (backend->mkdir(dir, S_IRWXU, test) < 0) { ERR("cannot create directory"); } /* check if correct permissions */ - } else if (access(dir, R_OK) != 0 || access(dir, W_OK) != 0 || - access(dir, X_OK) != 0) { + } else if (backend->access(dir, R_OK, test) != 0 || + backend->access(dir, W_OK, test) != 0 || + backend->access(dir, X_OK, test) != 0) { ERR("invalid directory permissions"); } From 912d93e94f432589e73c79efd959825090e71411 Mon Sep 17 00:00:00 2001 From: Sylvain Didelot Date: Wed, 3 Oct 2018 18:44:38 +0200 Subject: [PATCH 2/2] aiori-IME: add support of mkdir/rmdir to the backup ime_native_mkdir() and ime_native_rmdir() are available starting from IME native API version 1.3. --- src/aiori-IME.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/aiori-IME.c b/src/aiori-IME.c index 0862495..107b321 100755 --- a/src/aiori-IME.c +++ b/src/aiori-IME.c @@ -272,10 +272,10 @@ static char *IME_GetVersion() /* * XXX: statfs call is currently not exposed by IME native interface. */ -static int IME_StatFS(const char *oid, ior_aiori_statfs_t *stat_buf, +static int IME_StatFS(const char *path, ior_aiori_statfs_t *stat_buf, IOR_param_t *param) { - (void)oid; + (void)path; (void)stat_buf; (void)param; @@ -283,29 +283,33 @@ static int IME_StatFS(const char *oid, ior_aiori_statfs_t *stat_buf, return -1; } -/* - * XXX: mkdir call is currently not exposed by IME native interface. - */ -static int IME_MkDir(const char *oid, mode_t mode, IOR_param_t *param) +static int IME_MkDir(const char *path, mode_t mode, IOR_param_t *param) { - (void)oid; - (void)mode; (void)param; - WARN("mkdir is currently not supported in IME backend!"); +#if (IME_NATIVE_API_VERSION >= 130) + return ime_native_mkdir(path, mode); +#else + (void)path; + (void)mode; + + WARN("mkdir not supported in IME backend!"); return -1; +#endif } -/* - * XXX: rmdir call is curretly not exposed by IME native interface. - */ -static int IME_RmDir(const char *oid, IOR_param_t *param) +static int IME_RmDir(const char *path, IOR_param_t *param) { - (void)oid; (void)param; - WARN("rmdir is currently not supported in IME backend!"); +#if (IME_NATIVE_API_VERSION >= 130) + return ime_native_rmdir(path); +#else + (void)path; + + WARN("rmdir not supported in IME backend!"); return -1; +#endif } /*