diff options
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 25 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 7 |
2 files changed, 28 insertions, 4 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 2ab95d1f5..393367e45 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5006,8 +5006,8 @@ out: } int -glusterfs_mknod(glusterfs_handle_t handle, const char *path, mode_t mode, - dev_t dev) +glusterfs_glh_mknod(glusterfs_handle_t handle, const char *path, mode_t mode, + dev_t dev) { libglusterfs_client_ctx_t *ctx = handle; loc_t loc = {0, }; @@ -5054,6 +5054,27 @@ out: } int +glusterfs_mknod(const char *pathname, mode_t mode, dev_t dev) +{ + struct vmp_entry *entry = NULL; + char *vpath = NULL; + int op_ret = -1; + + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, pathname, out); + + entry = libgf_vmp_search_entry ((char *)pathname); + if (!entry) { + errno = ENODEV; + goto out; + } + + vpath = libgf_vmp_virtual_path (entry, pathname); + op_ret = glusterfs_glh_mknod (entry->handle, vpath, mode, dev); +out: + return op_ret; +} + +int glusterfs_mkfifo (glusterfs_handle_t handle, const char *path, mode_t mode) { diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index b4454a370..90cdc83e2 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -252,8 +252,11 @@ glusterfs_getdents (glusterfs_dir_t fd, struct dirent *dirp, unsigned int count); int -glusterfs_mknod(glusterfs_handle_t handle, const char *pathname, mode_t mode, - dev_t dev); +glusterfs_glh_mknod(glusterfs_handle_t handle, const char *pathname, + mode_t mode, dev_t dev); + +int +glusterfs_mknod(const char *pathname, mode_t mode, dev_t dev); char * glusterfs_realpath (glusterfs_handle_t handle, const char *path, |