From 369476e93e4ab99234602a5bbe2070d734b45567 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 1 Apr 2009 13:58:11 -0700 Subject: io-threads: Wire in support for symlink fop Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.c | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'xlators/performance') 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 @@ -481,6 +481,58 @@ iot_rmdir (call_frame_t *frame, return 0; } +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, @@ -1399,6 +1451,7 @@ struct xlator_fops fops = { .mknod = iot_mknod, .mkdir = iot_mkdir, .rmdir = iot_rmdir, + .symlink = iot_symlink, }; struct xlator_mops mops = { -- cgit