summaryrefslogtreecommitdiffstats
path: root/xlators/debug/trace/src/trace.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-02 03:08:02 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-06 06:35:18 -0700
commite1b3fa2194f0ec63b2206e081f7dc352d842ea53 (patch)
tree157ca5dc9b97c08d31af3c937e107211e1fa8aca /xlators/debug/trace/src/trace.c
parent95b6af6c355dfd5f705fd152884d6a40c8676b2c (diff)
trace: 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/trace/src/trace.c')
-rw-r--r--xlators/debug/trace/src/trace.c37
1 files changed, 37 insertions, 0 deletions
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,