summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 13:56:50 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:18:51 +0530
commitef73c3de6097c6114b5492d5972c257b849e10b7 (patch)
tree4b136c2208457323b6e892bd37b93e71710506e9
parentd767455020f9730793230a14cd9e795194c5257f (diff)
io-threads: Wire in support for readlink fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--xlators/performance/io-threads/src/io-threads.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index b429c4b2d..02e0107a9 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -312,6 +312,48 @@ iot_access (call_frame_t *frame,
}
int32_t
+iot_readlink_cbk (call_frame_t *frame,
+ void * cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ const char *path)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, path);
+ return 0;
+}
+
+int32_t
+iot_readlink_wrapper (call_frame_t *frame,
+ xlator_t *this,
+ loc_t *loc,
+ size_t size)
+{
+ STACK_WIND (frame, iot_readlink_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->readlink, loc, size);
+ return 0;
+}
+
+int32_t
+iot_readlink (call_frame_t *frame,
+ xlator_t *this,
+ loc_t *loc,
+ size_t size)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_readlink_stub (frame, iot_readlink_wrapper, loc, size);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get readlink stub");
+ STACK_UNWIND (frame, -1, ENOMEM, 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,
@@ -1225,6 +1267,7 @@ struct xlator_fops fops = {
.chown = iot_chown,
.fchown = iot_fchown,
.access = iot_access,
+ .readlink = iot_readlink,
};
struct xlator_mops mops = {