summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-21 04:48:45 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-22 13:06:30 +0530
commitd7753849cc66c3aef66dc1270920389d3c42e7ce (patch)
tree5d3f5805d89208a7b0e90a72583de07550907b73
parent6b426bc53e2e6106e32568f09354d4e4ce382f11 (diff)
io-threads: Add getxattr fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-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 93a529575..ebd074faa 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1638,6 +1638,49 @@ iot_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
return 0;
}
+int
+iot_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *dict)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, dict);
+ return 0;
+}
+
+int
+iot_getxattr_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name)
+{
+ STACK_WIND (frame, iot_getxattr_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->getxattr, loc, name);
+ return 0;
+}
+
+int
+iot_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name)
+{
+ call_stub_t *stub = NULL;
+ fd_t *fd = NULL;
+
+ stub = fop_getxattr_stub (frame, iot_getxattr_wrapper, loc, name);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get getxattr stub");
+ STACK_UNWIND (frame, -1, ENOMEM, NULL);
+ 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,
@@ -2164,6 +2207,7 @@ struct xlator_fops fops = {
.fsyncdir = iot_fsyncdir, /* O */
.statfs = iot_statfs, /* U */
.setxattr = iot_setxattr, /* U */
+ .getxattr = iot_getxattr, /* U */
};
struct xlator_mops mops = {