diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-20 12:36:44 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-21 12:50:21 +0530 |
commit | 6bff99a8f92befa78ddea62519a05f945db5cdfa (patch) | |
tree | 3aa0048042c1d34ac3d617a686a7f2d30680bd84 /libglusterfsclient/src | |
parent | cf22fd1d0430705e226d61ff8d9492925ce95d46 (diff) |
libglusterfsclient: Add VMP-based realpath
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 25 | ||||
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 5 |
2 files changed, 27 insertions, 3 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index f8fa1492e..160df1cb3 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5480,8 +5480,8 @@ out: } char * -glusterfs_realpath (glusterfs_handle_t handle, const char *path, - char *resolved_path) +glusterfs_glh_realpath (glusterfs_handle_t handle, const char *path, + char *resolved_path) { char *buf = NULL, *extra_buf = NULL; char *rpath = NULL; @@ -5664,6 +5664,27 @@ err: return NULL; } +char * +glusterfs_realpath (const char *path, char *resolved_path) +{ + struct vmp_entry *entry = NULL; + char *vpath = NULL; + char *res = 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); + res = glusterfs_glh_realpath (entry->handle, vpath, resolved_path); +out: + return res; +} + static struct xlator_fops libgf_client_fops = { }; diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index e4187d82a..93476a6a2 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -259,9 +259,12 @@ int glusterfs_mknod(const char *pathname, mode_t mode, dev_t dev); char * -glusterfs_realpath (glusterfs_handle_t handle, const char *path, +glusterfs_glh_realpath (glusterfs_handle_t handle, const char *path, char *resolved_path); +char * +glusterfs_realpath (const char *path, char *resolved_path); + int glusterfs_mount (char *vmp, glusterfs_init_params_t *ipars); |