diff options
author | Raghavendra G <raghavendra@gluster.com> | 2010-12-13 23:02:34 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-12-14 19:42:25 -0800 |
commit | 4acbecec9a605ba4f1ba360923d7903465183e1a (patch) | |
tree | 66350587e87214f5ba815431907fbfb677ee70af | |
parent | 6da4cc87ff5545bd2ae7d5a45a4468e77aac2198 (diff) |
performance/io-threads: implement rchecksum fop.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2220 (Implement rchecksum fop)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2220
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index e99012cc0d6..8c15a96a5c6 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1989,6 +1989,57 @@ out: } +int32_t +iot_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, + uint8_t *strong_checksum) +{ + STACK_UNWIND_STRICT (rchecksum, frame, op_ret, op_errno, weak_checksum, + strong_checksum); + return 0; +} + + +int32_t +iot_rchecksum_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd, + off_t offset, int32_t len) +{ + STACK_WIND (frame, iot_rchecksum_cbk, FIRST_CHILD(this), + FIRST_CHILD(this)->fops->rchecksum, fd, offset, len); + return 0; +} + + +int32_t +iot_rchecksum (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, + int32_t len) +{ + call_stub_t *stub = NULL; + int ret = -1; + + stub = fop_rchecksum_stub (frame, iot_rchecksum_wrapper, fd, offset, + len); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR, "cannot create rchecksum stub" + "(out of memory)"); + ret = -ENOMEM; + goto out; + } + + ret = iot_schedule_ordered ((iot_conf_t *)this->private, fd->inode, + stub); +out: + if (ret < 0) { + STACK_UNWIND_STRICT (rchecksum, frame, -1, -ret, -1, NULL); + if (stub != NULL) { + call_stub_destroy (stub); + } + } + + return 0; +} + + int iot_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, gf_dirent_t *entries) @@ -2911,6 +2962,7 @@ struct xlator_fops fops = { .readdirp = iot_readdirp, /* O */ .xattrop = iot_xattrop, /* U */ .fxattrop = iot_fxattrop, /* O */ + .rchecksum = iot_rchecksum, /* O */ }; struct xlator_mops mops = { |