From 282a39c19ee15f8908eb28f0b2d6983b665d57a7 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 21 Apr 2009 04:47:56 -0700 Subject: io-threads: Add opendir fop Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.c | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'xlators/performance/io-threads') 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 = { -- cgit