summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:32:29 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:49:22 +0530
commit721783da4f9705331356328b8082873aec1ced0e (patch)
tree52dfba52025fa472463f2e0098acef5e69eec705 /libglusterfsclient/src
parent07da4292a8678a415acfec130c40febc9a63b6b4 (diff)
libglusterfsclient: Add VMP-based rmdir
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c24
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h7
2 files changed, 25 insertions, 6 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 3ce02e7e92c..969115d8369 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -3767,8 +3767,7 @@ out:
}
int32_t
-glusterfs_rmdir (glusterfs_handle_t handle,
- const char *path)
+glusterfs_glh_rmdir (glusterfs_handle_t handle, const char *path)
{
libglusterfs_client_ctx_t *ctx = handle;
loc_t loc = {0, };
@@ -3815,6 +3814,27 @@ out:
return op_ret;
}
+int32_t
+glusterfs_rmdir (const char *path)
+{
+ 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_rmdir (entry->handle, vpath);
+out:
+ return op_ret;
+}
+
int
libgf_client_chmod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct stat *buf)
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index 6890ca55aa6..3399e82599f 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -115,9 +115,6 @@ glusterfs_file_t
glusterfs_creat (const char *path, mode_t mode);
int
-glusterfs_rmdir (glusterfs_handle_t handle, const char *path);
-
-int
glusterfs_close (glusterfs_file_t fd);
int
@@ -236,8 +233,10 @@ int
glusterfs_mkdir (const char *path, mode_t mode);
int
-glusterfs_rmdir (glusterfs_handle_t handle, const char *path);
+glusterfs_glh_rmdir (glusterfs_handle_t handle, const char *path);
+int
+glusterfs_rmdir (const char *path);
/* FIXME: implement man 3 readdir semantics */
int
glusterfs_readdir (glusterfs_dir_t fd, struct dirent *dirp,