diff options
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 25 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 7 |
2 files changed, 30 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 0914cbaa4..eca466fff 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -3962,8 +3962,8 @@ out: } int -glusterfs_chown (glusterfs_handle_t handle, const char *path, uid_t owner, - gid_t group) +glusterfs_glh_chown (glusterfs_handle_t handle, const char *path, uid_t owner, + gid_t group) { int op_ret = -1; libglusterfs_client_ctx_t *ctx = handle; @@ -3994,6 +3994,27 @@ out: return op_ret; } +int +glusterfs_chown (const char *path, uid_t owner, gid_t group) +{ + 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_chown (entry->handle, vpath, owner, group); +out: + return op_ret; +} + glusterfs_dir_t glusterfs_opendir (glusterfs_handle_t handle, const char *path) { diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index 6cec3fcea..c9fc15a11 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -263,6 +263,13 @@ glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode); int glusterfs_chmod (const char *path, mode_t mode); + +int +glusterfs_glh_chown (glusterfs_handle_t handle, const char *path, uid_t owner, + gid_t group); + +int +glusterfs_chown (const char *path, uid_t owner, gid_t group); /* FIXME: review the need for these apis */ /* added for log related initialization in booster fork implementation */ void |