From a9febb4bd30f41681755a0ee925ae3de6f0fa292 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Mon, 20 Apr 2009 12:36:05 -0700 Subject: libglusterfsclient: Add VMP-based symlink Signed-off-by: Anand V. Avati --- libglusterfsclient/src/libglusterfsclient.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'libglusterfsclient/src/libglusterfsclient.c') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 49456fbce..707a4f72d 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5284,8 +5284,8 @@ out: } int -glusterfs_symlink (glusterfs_handle_t handle, const char *oldpath, - const char *newpath) +glusterfs_glh_symlink (glusterfs_handle_t handle, const char *oldpath, + const char *newpath) { int32_t op_ret = -1; libglusterfs_client_ctx_t *ctx = handle; @@ -5355,6 +5355,29 @@ out: return op_ret; } +int +glusterfs_symlink (const char *oldpath, const char *newpath) +{ + struct vmp_entry *entry = NULL; + char *vpath = NULL; + int op_ret = -1; + + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, oldpath, out); + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, newpath, out); + + entry = libgf_vmp_search_entry ((char *)newpath); + if (!entry) { + errno = ENODEV; + goto out; + } + + vpath = libgf_vmp_virtual_path (entry, newpath); + op_ret = glusterfs_glh_symlink (entry->handle, oldpath, vpath); +out: + return op_ret; +} + + int32_t libgf_client_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, -- cgit