summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:33:26 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:49:36 +0530
commit12d9b4cccd559776f125440a232ff5b944ab3442 (patch)
tree3e5d8719942b65d9e63fe1fc3e9058089a86f68e
parente2ba80403c3e73220a2b48b813df1561a9081e09 (diff)
libglusterfsclient: Add VMP-based opendir
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c23
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h7
2 files changed, 29 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index eca466fffdc..676fd8a6463 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)
{
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index c9fc15a1157..377459c4d61 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -270,6 +270,13 @@ glusterfs_glh_chown (glusterfs_handle_t handle, const char *path, uid_t owner,
int
glusterfs_chown (const char *path, uid_t owner, gid_t group);
+
+glusterfs_dir_t
+glusterfs_glh_opendir (glusterfs_handle_t handle, const char *path);
+
+glusterfs_dir_t
+glusterfs_opendir (const char *path);
+
/* FIXME: review the need for these apis */
/* added for log related initialization in booster fork implementation */
void