summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--booster/src/booster.c28
-rw-r--r--booster/src/booster_stat.c9
2 files changed, 37 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index b9d870d8cb5..64a005e844c 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -195,6 +195,7 @@ static ssize_t (*real_lgetxattr) (const char *path, const char *name,
void *value, size_t size);
static int (*real_remove) (const char* path);
static int (*real_lchown) (const char *path, uid_t owner, gid_t group);
+static void (*real_rewinddir) (DIR *dirp);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -2084,6 +2085,32 @@ out:
return ret;
}
+void
+booster_rewinddir (DIR *dir)
+{
+ struct booster_dir_handle *bh = (struct booster_dir_handle *)dir;
+
+ if (!bh) {
+ errno = EFAULT;
+ goto out;
+ }
+
+ if (bh->type == BOOSTER_GL_DIR)
+ glusterfs_rewinddir ((glusterfs_dir_t)bh->dirh);
+ else if (bh->type == BOOSTER_POSIX_DIR) {
+ if (real_rewinddir == NULL) {
+ errno = ENOSYS;
+ goto out;
+ }
+
+ real_rewinddir ((DIR *)bh->dirh);
+ } else
+ errno = EINVAL;
+out:
+ return;
+}
+
+
pid_t
fork (void)
{
@@ -2174,6 +2201,7 @@ _init (void)
RESOLVE (lgetxattr);
RESOLVE (remove);
RESOLVE (lchown);
+ RESOLVE (rewinddir);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient
diff --git a/booster/src/booster_stat.c b/booster/src/booster_stat.c
index 6616c04ced8..9c58b0c9a3b 100644
--- a/booster/src/booster_stat.c
+++ b/booster/src/booster_stat.c
@@ -62,6 +62,9 @@ booster_statvfs64 (const char *path, void *buf);
extern void *
booster_readdir (void *dir);
+extern void
+booster_rewinddir (void *dir);
+
int
stat (const char *path, void *buf)
{
@@ -169,3 +172,9 @@ readdir64 (void *dir)
{
return booster_readdir (dir);
}
+
+void
+rewinddir (void *dir)
+{
+ return booster_rewinddir (dir);
+}