summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-21 04:47:56 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-22 13:06:30 +0530
commit282a39c19ee15f8908eb28f0b2d6983b665d57a7 (patch)
tree4b93ae7ac65c085900a4b8adcac332fa46534492 /xlators/performance
parentcdbeb01abbfc26345df98e5a98a0e5ed513b7cf8 (diff)
io-threads: Add opendir fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 31581fe24..1dc6094d4 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1496,6 +1496,39 @@ iot_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc)
return 0;
}
+int
+iot_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, fd);
+ return 0;
+}
+
+int
+iot_opendir_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd)
+{
+ STACK_WIND (frame, iot_opendir_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->opendir, loc, fd);
+ return 0;
+}
+
+int
+iot_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_opendir_stub (frame, iot_opendir_wrapper, loc, fd);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get opendir stub");
+ STACK_UNWIND (frame, -1, ENOMEM, NULL);
+ return 0;
+ }
+
+ iot_schedule_unordered ((iot_conf_t *)this->private, loc->inode, stub);
+
+ return 0;
+}
+
/* Must be called with worker lock held */
void
_iot_queue (iot_worker_t *worker,
@@ -2018,6 +2051,7 @@ struct xlator_fops fops = {
.symlink = iot_symlink, /* U */
.rename = iot_rename, /* U */
.link = iot_link, /* U */
+ .opendir = iot_opendir, /* U */
};
struct xlator_mops mops = {