From e1b3fa2194f0ec63b2206e081f7dc352d842ea53 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Fri, 2 Oct 2009 03:08:02 +0000 Subject: trace: 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/trace/src/trace.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'xlators') diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index 970f75a8dae..4258441368d 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -310,6 +310,24 @@ trace_readdir_cbk (call_frame_t *frame, return 0; } +int32_t +trace_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, gf_dirent_t *buf) +{ + ERR_EINVAL_NORETURN (!this ); + + if (trace_fop_names[GF_FOP_READDIRP].enabled) { + gf_log (this->name, GF_LOG_NORMAL, + "%"PRId64" :(op_ret=%d, op_errno=%d)", + frame->root->unique, op_ret, op_errno); + } + + STACK_UNWIND (frame, op_ret, op_errno, buf); + + return 0; +} + + int32_t trace_fsync_cbk (call_frame_t *frame, void *cookie, @@ -2097,6 +2115,24 @@ trace_getdents (call_frame_t *frame, return 0; } +int32_t +trace_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, + off_t offset) +{ + ERR_EINVAL_NORETURN (!this || !fd); + + if (trace_fop_names[GF_FOP_READDIRP].enabled) { + gf_log (this->name, GF_LOG_NORMAL, + "%"PRId64": (fd=%p, size=%"GF_PRI_SIZET", offset=%"PRId64")", + frame->root->unique, fd, size, offset); + } + + STACK_WIND (frame, trace_readdirp_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->readdirp, fd, size, offset); + + return 0; +} + int32_t trace_readdir (call_frame_t *frame, @@ -2464,6 +2500,7 @@ struct xlator_fops fops = { .removexattr = trace_removexattr, .opendir = trace_opendir, .readdir = trace_readdir, + .readdirp = trace_readdirp, .fsyncdir = trace_fsyncdir, .access = trace_access, .ftruncate = trace_ftruncate, -- cgit