diff options
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 23 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 5 |
2 files changed, 27 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 969115d8369..0914cbaa4a3 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -3871,7 +3871,7 @@ out: } int -glusterfs_chmod (glusterfs_handle_t handle, const char *path, mode_t mode) +glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode) { int op_ret = -1; libglusterfs_client_ctx_t *ctx = handle; @@ -3905,6 +3905,27 @@ out: } int +glusterfs_chmod (const char *path, mode_t mode) +{ + struct vmp_entry *entry = NULL; + int op_ret = -1; + char *vpath = NULL; + + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, path, out); + + entry = libgf_vmp_search_entry ((char *)path); + if (!entry) { + errno = ENODEV; + goto out; + } + + vpath = libgf_vmp_virtual_path (entry, path); + op_ret = glusterfs_glh_chmod (entry->handle, vpath, mode); +out: + return op_ret; +} + +int libgf_client_chown_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct stat *sbuf) { diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index 3399e82599f..6cec3fcea64 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -258,6 +258,11 @@ glusterfs_realpath (glusterfs_handle_t handle, const char *path, int glusterfs_mount (char *vmp, glusterfs_init_params_t *ipars); +int +glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode); + +int +glusterfs_chmod (const char *path, mode_t mode); /* FIXME: review the need for these apis */ /* added for log related initialization in booster fork implementation */ void |