summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:32:46 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:49:27 +0530
commit74a46284e17045db302e5bcde0052ea6c7b4c038 (patch)
tree1bdabbfa6d3314341b7eeb9481a3ea14f8028ce4 /libglusterfsclient
parent721783da4f9705331356328b8082873aec1ced0e (diff)
libglusterfsclient: Add VMP-based chmod
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c23
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h5
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