summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:36:05 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:50:13 +0530
commita9febb4bd30f41681755a0ee925ae3de6f0fa292 (patch)
tree0c1e0dee958092b31fc3df18ae17d35e362b0d97 /libglusterfsclient
parentcb95018adab1377c862dca32f58825b336adafd0 (diff)
libglusterfsclient: Add VMP-based symlink
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c27
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h7
2 files changed, 32 insertions, 2 deletions
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,
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index 3287ddead..3a92461fe 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