Merge pull request #103 from DDNStorage/ime_mkdir_rmdir

IME: add support of mkdir/rmdir into the IME backend
master
Julian Kunkel 2018-10-16 14:34:26 +01:00 committed by GitHub
commit f7dc084f32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 19 deletions

View File

@ -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
}
/*

View File

@ -820,14 +820,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");
}