diff options
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 27 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 7 |
2 files changed, 32 insertions, 2 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 49456fbce62..707a4f72dd9 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, diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index 3287ddead51..3a92461fead 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -331,6 +331,13 @@ glusterfs_glh_unlink (glusterfs_handle_t handle, const char *path); int glusterfs_unlink (const char *path); + +int +glusterfs_glh_symlink (glusterfs_handle_t handle, const char *oldpath, + const char *newpath); + +int +glusterfs_symlink (const char *oldpath, const char *newpath); /* FIXME: review the need for these apis */ /* added for log related initialization in booster fork implementation */ void |