From 12d9b4cccd559776f125440a232ff5b944ab3442 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Mon, 20 Apr 2009 12:33:26 -0700 Subject: libglusterfsclient: Add VMP-based opendir Signed-off-by: Anand V. Avati --- libglusterfsclient/src/libglusterfsclient.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'libglusterfsclient/src/libglusterfsclient.c') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index eca466fff..676fd8a64 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -4016,7 +4016,7 @@ out: } glusterfs_dir_t -glusterfs_opendir (glusterfs_handle_t handle, const char *path) +glusterfs_glh_opendir (glusterfs_handle_t handle, const char *path) { int op_ret = -1; libglusterfs_client_ctx_t *ctx = handle; @@ -4073,6 +4073,27 @@ out: return dirfd; } +glusterfs_dir_t +glusterfs_opendir (const char *path) +{ + struct vmp_entry *entry = NULL; + char *vpath = NULL; + glusterfs_dir_t dir = 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); + dir = glusterfs_glh_opendir (entry->handle, vpath); +out: + return dir; +} + int glusterfs_closedir (glusterfs_dir_t dirfd) { -- cgit