summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c21
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h13
2 files changed, 33 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 0cfc23e9ef2..3321630d80e 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 = {
};
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index 5376985dbaa..ccf115f1eaf 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -1192,6 +1192,18 @@ glusterfs_glh_lchown (glusterfs_handle_t handle, const char *path, uid_t owner,
int
glusterfs_lchown (const char *path, uid_t owner, gid_t group);
+
+
+
+/* Rewind directory stream pointer to beginning of the directory.
+ *
+ * @dirfd : Directory handle returned by glusterfs_open on
+ * glusterfs_opendir.
+ *
+ * Returns no value.
+ */
+void
+glusterfs_rewinddir (glusterfs_dir_t dirfd);
/* FIXME: review the need for these apis */
/* added for log related initialization in booster fork implementation */
void
@@ -1208,7 +1220,6 @@ glusterfs_log_unlock (void);
void
glusterfs_free (glusterfs_iobuf_t *buf);
-
__END_DECLS
#endif /* !_LIBGLUSTERFSCLIENT_H */