From dffa5a92c70732e790b6c789e2aacb7f8c5c34cc Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 1 Apr 2009 13:54:33 -0700 Subject: io-threads: Wire in support for lookup fop Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.c | 46 +++++++++++++++++++++++++ 1 file changed, 46 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 8c0674d6e23..d7a5db99dbc 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -51,6 +51,51 @@ iot_schedule (iot_conf_t *conf, iot_queue (selected_worker, stub); } +int32_t +iot_lookup_cbk (call_frame_t *frame, + void * cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, + struct stat *buf, + dict_t *xattr) +{ + STACK_UNWIND (frame, op_ret, op_errno, inode, buf, xattr); + return 0; +} + +int32_t +iot_lookup_wrapper (call_frame_t *frame, + xlator_t *this, + loc_t *loc, + dict_t *xattr_req) +{ + STACK_WIND (frame, iot_lookup_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->lookup, loc, xattr_req); + return 0; +} + +int32_t +iot_lookup (call_frame_t *frame, + xlator_t *this, + loc_t *loc, + dict_t *xattr_req) +{ + call_stub_t *stub = NULL; + + stub = fop_lookup_stub (frame, iot_lookup_wrapper, loc, xattr_req); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR, + "cannot get lookup stub"); + STACK_UNWIND (frame, -1, ENOMEM, NULL, NULL, NULL); + return 0; + } + + iot_schedule ((iot_conf_t *)this->private, loc->inode, stub); + return 0; +} + int32_t iot_open_cbk (call_frame_t *frame, void *cookie, @@ -959,6 +1004,7 @@ struct xlator_fops fops = { .utimens = iot_utimens, .checksum = iot_checksum, .unlink = iot_unlink, + .lookup = iot_lookup, }; struct xlator_mops mops = { -- cgit