From d4bd1b3945d6792f7f8ec05b1bb642adfc824aa6 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Fri, 2 Oct 2009 03:08:00 +0000 Subject: error-gen: Support readdirp fop Signed-off-by: Anand V. Avati BUG: 292 (Separate readdirp functionality from readdir fop) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=292 --- xlators/debug/error-gen/src/error-gen.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 @@ -1604,6 +1604,33 @@ error_gen_readdir (call_frame_t *frame, return 0; } +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, -- cgit