diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-01 13:54:33 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-02 19:18:27 +0530 |
commit | dffa5a92c70732e790b6c789e2aacb7f8c5c34cc (patch) | |
tree | 1545e505f81be96880d07b8a46d0ec9788976007 /xlators | |
parent | b91e83aa0d3891b4cd725b6044131096405dfba8 (diff) |
io-threads: Wire in support for lookup fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 46 |
1 files changed, 46 insertions, 0 deletions
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 @@ -52,6 +52,51 @@ iot_schedule (iot_conf_t *conf, } 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, xlator_t *this, @@ -959,6 +1004,7 @@ struct xlator_fops fops = { .utimens = iot_utimens, .checksum = iot_checksum, .unlink = iot_unlink, + .lookup = iot_lookup, }; struct xlator_mops mops = { |