diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-01 13:57:18 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-02 19:18:54 +0530 |
commit | cbf8858a230b91174dc6134e4729a047db6ff914 (patch) | |
tree | c9ff41f9d7e5d051873ded4f01121a719c2d9821 /xlators/performance/io-threads/src | |
parent | ef73c3de6097c6114b5492d5972c257b849e10b7 (diff) |
io-threads: Wire in support for mknod fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src')
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 02e0107a9e0..dcd4522afe9 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -354,6 +354,52 @@ iot_readlink (call_frame_t *frame, } int32_t +iot_mknod_cbk (call_frame_t *frame, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, + struct stat *buf) +{ + STACK_UNWIND (frame, op_ret, op_errno, inode, buf); + return 0; +} + +int32_t +iot_mknod_wrapper (call_frame_t *frame, + xlator_t *this, + loc_t *loc, + mode_t mode, + dev_t rdev) +{ + STACK_WIND (frame, iot_mknod_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->mknod, loc, mode, rdev); + return 0; +} + +int32_t +iot_mknod (call_frame_t *frame, + xlator_t *this, + loc_t *loc, + mode_t mode, + dev_t rdev) +{ + call_stub_t *stub = NULL; + + stub = fop_mknod_stub (frame, iot_mknod_wrapper, loc, mode, rdev); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR, "cannot get mknod stub"); + STACK_UNWIND (frame, -1, ENOMEM, 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, @@ -1268,6 +1314,7 @@ struct xlator_fops fops = { .fchown = iot_fchown, .access = iot_access, .readlink = iot_readlink, + .mknod = iot_mknod, }; struct xlator_mops mops = { |