diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-20 12:33:06 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-21 12:49:31 +0530 |
commit | e2ba80403c3e73220a2b48b813df1561a9081e09 (patch) | |
tree | 7dc2933491c26932bcd7dd033347740affdd71d0 /libglusterfsclient/src/libglusterfsclient.c | |
parent | 74a46284e17045db302e5bcde0052ea6c7b4c038 (diff) |
libglusterfsclient: Add VMP-based chown
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 0914cbaa4a3..eca466fffdc 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) { |