summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-11 18:22:42 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-18 19:12:41 +0530
commitdddcf498610ebd332992e9600dd728cc87e6355d (patch)
tree60e66e6de932e121755ba6f90af7b7ebee62bb74 /libglusterfsclient/src/libglusterfsclient.c
parentaeda0a31977e8da295b913e6a306ff01ccf0ce0a (diff)
libglusterfsclient: Add rewinddir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 0cfc23e9e..3321630d8 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -6428,6 +6428,27 @@ out:
return op_ret;
}
+void
+glusterfs_rewinddir (glusterfs_dir_t dirfd)
+{
+ libglusterfs_client_fd_ctx_t *fd_ctx = NULL;
+
+ fd_ctx = libgf_get_fd_ctx ((fd_t *)dirfd);
+ if (!fd_ctx) {
+ errno = EBADF;
+ goto out;
+ }
+
+ pthread_mutex_lock (&fd_ctx->lock);
+ {
+ fd_ctx->offset = 0;
+ }
+ pthread_mutex_unlock (&fd_ctx->lock);
+
+out:
+ return;
+}
+
static struct xlator_fops libgf_client_fops = {
};