summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:35:50 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:50:09 +0530
commitcb95018adab1377c862dca32f58825b336adafd0 (patch)
tree7e14a34e41ebfc71cc40ab82a9f0140a3cbc77f0
parent6f91c9dc86be9c10467ccb5bc3edde2c5d767b9f (diff)
libglusterfsclient: Add VMP-based unlink
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c23
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h6
2 files changed, 28 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index b907ea477..49456fbce 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -5180,7 +5180,7 @@ out:
}
int
-glusterfs_unlink (glusterfs_handle_t handle, const char *path)
+glusterfs_glh_unlink (glusterfs_handle_t handle, const char *path)
{
int32_t op_ret = -1;
loc_t loc = {0, };
@@ -5218,6 +5218,27 @@ out:
return op_ret;
}
+int
+glusterfs_unlink (const char *path)
+{
+ struct vmp_entry *entry = NULL;
+ char *vpath = NULL;
+ int op_ret = -1;
+
+ 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_unlink (entry->handle, vpath);
+out:
+ return op_ret;
+}
+
static int32_t
libgf_client_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index b9afe4824..3287ddead 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -325,6 +325,12 @@ glusterfs_glh_mkfifo (glusterfs_handle_t handle, const char *path,
int
glusterfs_mkfifo (const char *path, mode_t mode);
+
+int
+glusterfs_glh_unlink (glusterfs_handle_t handle, const char *path);
+
+int
+glusterfs_unlink (const char *path);
/* FIXME: review the need for these apis */
/* added for log related initialization in booster fork implementation */
void