summaryrefslogtreecommitdiffstats
path: root/xlators/debug/error-gen
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-02 03:08:00 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-06 06:35:11 -0700
commitd4bd1b3945d6792f7f8ec05b1bb642adfc824aa6 (patch)
treeb07e43372a4ed9e1465526f0a81079f8f8cdc34f /xlators/debug/error-gen
parent12947025dd2acd58b233d1c83efcab1038764189 (diff)
error-gen: Support readdirp fop
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 292 (Separate readdirp functionality from readdir fop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=292
Diffstat (limited to 'xlators/debug/error-gen')
-rw-r--r--xlators/debug/error-gen/src/error-gen.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c
index 00599511f..6040c38f4 100644
--- a/xlators/debug/error-gen/src/error-gen.c
+++ b/xlators/debug/error-gen/src/error-gen.c
@@ -1605,6 +1605,33 @@ error_gen_readdir (call_frame_t *frame,
}
int32_t
+error_gen_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, gf_dirent_t *entries)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, entries);
+ return 0;
+}
+
+
+int32_t
+error_gen_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off)
+{
+ int op_errno = 0;
+ op_errno = error_gen(this);
+ if (op_errno) {
+ GF_ERROR(this, "unwind(-1, %s)", strerror (op_errno));
+ STACK_UNWIND (frame, -1, op_errno, NULL);
+ return 0;
+ }
+
+ STACK_WIND (frame, error_gen_readdirp_cbk, FIRST_CHILD(this),
+ FIRST_CHILD(this)->fops->readdirp, fd, size, off);
+ return 0;
+}
+
+
+int32_t
error_gen_closedir (xlator_t *this,
fd_t *fd)
{
@@ -1671,6 +1698,7 @@ struct xlator_fops fops = {
.removexattr = error_gen_removexattr,
.opendir = error_gen_opendir,
.readdir = error_gen_readdir,
+ .readdirp = error_gen_readdirp,
.getdents = error_gen_getdents,
.fsyncdir = error_gen_fsyncdir,
.access = error_gen_access,