summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 13:58:11 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:19:04 +0530
commit369476e93e4ab99234602a5bbe2070d734b45567 (patch)
tree1ab693a0c943bcd0bbb9b0c90df1ee7bfb2cbb04 /xlators/performance
parent6afeb9dd1bb9f329b5b0508d49c2e5142c6fc8cc (diff)
io-threads: Wire in support for symlink fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index bf0393144..d3b4dc294 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -482,6 +482,58 @@ iot_rmdir (call_frame_t *frame,
}
int32_t
+iot_symlink_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_symlink_wrapper (call_frame_t *frame,
+ xlator_t *this,
+ const char *linkname,
+ loc_t *loc)
+{
+ STACK_WIND (frame, iot_symlink_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->symlink, linkname, loc);
+ return 0;
+}
+
+int32_t
+iot_symlink (call_frame_t *frame,
+ xlator_t *this,
+ const char *linkname,
+ loc_t *loc)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_symlink_stub (frame, iot_symlink_wrapper, linkname, loc);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get symlink stub");
+ STACK_UNWIND (frame, -1, ENOMEM, NULL, NULL);
+ return 0;
+ }
+
+ /* Passing loc->inode does not make sense right now.
+ * Why? because passing
+ * loc->inode makes the request get ordered on the target
+ * file's thread, while we shouldnt really worry because this
+ * operation will not change the target in loc. For now, know
+ * that this works. Such requests, which operate on a new
+ * file/link, such as that in linkname, will be sent to a pool of
+ * requests meant specifically for meta-data requests.
+ */
+ 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,
@@ -1399,6 +1451,7 @@ struct xlator_fops fops = {
.mknod = iot_mknod,
.mkdir = iot_mkdir,
.rmdir = iot_rmdir,
+ .symlink = iot_symlink,
};
struct xlator_mops mops = {