diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-20 12:32:06 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-21 12:49:13 +0530 |
commit | 07da4292a8678a415acfec130c40febc9a63b6b4 (patch) | |
tree | 8c0598baae3fa6537634d705b3e3d87cbd8024d8 /libglusterfsclient | |
parent | dc53183708d6d9ff998487427312000f30dcb7ee (diff) |
libglusterfsclient: Add VMP-based mkdir
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 25 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 8 |
2 files changed, 26 insertions, 7 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 2d940ca1626..3ce02e7e92c 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -3658,9 +3658,7 @@ out: int32_t -glusterfs_mkdir (glusterfs_handle_t handle, - const char *path, - mode_t mode) +glusterfs_glh_mkdir (glusterfs_handle_t handle, const char *path, mode_t mode) { libglusterfs_client_ctx_t *ctx = handle; loc_t loc = {0, }; @@ -3712,6 +3710,27 @@ out: return op_ret; } +int32_t +glusterfs_mkdir (const char *path, mode_t mode) +{ + 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_mkdir (entry->handle, vpath, mode); +out: + return op_ret; +} + static int32_t libgf_client_rmdir_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 5d422b9070d..6890ca55aa6 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_mkdir (glusterfs_handle_t handle, const char *path, mode_t mode); - -int glusterfs_rmdir (glusterfs_handle_t handle, const char *path); int @@ -233,7 +230,10 @@ off_t glusterfs_lseek (glusterfs_file_t fd, off_t offset, int whence); int -glusterfs_mkdir (glusterfs_handle_t handle, const char *path, mode_t mode); +glusterfs_glh_mkdir (glusterfs_handle_t handle, const char *path, mode_t mode); + +int +glusterfs_mkdir (const char *path, mode_t mode); int glusterfs_rmdir (glusterfs_handle_t handle, const char *path); |