diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-20 12:32:46 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-21 12:49:27 +0530 |
commit | 74a46284e17045db302e5bcde0052ea6c7b4c038 (patch) | |
tree | 1bdabbfa6d3314341b7eeb9481a3ea14f8028ce4 /libglusterfsclient/src | |
parent | 721783da4f9705331356328b8082873aec1ced0e (diff) |
libglusterfsclient: Add VMP-based chmod
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src')
-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 |