summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-21 04:49:55 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-22 13:06:31 +0530
commite246a3131676197aff0430429db1e7d7cc00be65 (patch)
treea2e9cd346d8a8aec92b6406de373501f0e34d7b7 /xlators/performance/io-threads/src/io-threads.c
parenta9b4360d889097e8ea25497eb669daebcaf1e381 (diff)
io-threads: Add xattrop fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.c')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 9655fc60d..1297395d6 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1827,6 +1827,49 @@ iot_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
return 0;
}
+int
+iot_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xattr)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, xattr);
+ return 0;
+}
+
+int
+iot_xattrop_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t optype, dict_t *xattr)
+{
+ STACK_WIND (frame, iot_xattrop_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->xattrop, loc, optype, xattr);
+ return 0;
+}
+
+int
+iot_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ gf_xattrop_flags_t optype, dict_t *xattr)
+{
+ call_stub_t *stub = NULL;
+ fd_t *fd = NULL;
+
+ stub = fop_xattrop_stub (frame, iot_xattrop_wrapper, loc, optype,
+ xattr);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get xattrop stub");
+ STACK_UNWIND (frame, -1, ENOMEM);
+ return 0;
+ }
+
+ fd = fd_lookup (loc->inode, frame->root->pid);
+ if (!fd)
+ iot_schedule_unordered ((iot_conf_t *)this->private, loc->inode, stub);
+ else {
+ iot_schedule_ordered ((iot_conf_t *)this->private, loc->inode, stub);
+ fd_unref (fd);
+ }
+
+ return 0;
+}
+
/* Must be called with worker lock held */
void
_iot_queue (iot_worker_t *worker,
@@ -2358,6 +2401,7 @@ struct xlator_fops fops = {
.fsetxattr = iot_fsetxattr, /* O */
.removexattr = iot_removexattr, /* U */
.readdir = iot_readdir, /* O */
+ .xattrop = iot_xattrop, /* U */
};
struct xlator_mops mops = {