summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-21 04:48:56 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-22 13:06:31 +0530
commita77340b94147a078918536a5297746803c846809 (patch)
treea0513b443cb004f207e56668d02d5a0aeafff052
parentd7753849cc66c3aef66dc1270920389d3c42e7ce (diff)
io-threads: Add fgetxattr fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--xlators/performance/io-threads/src/io-threads.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index ebd074faa0f..11aa7bb516c 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1680,6 +1680,39 @@ iot_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
return 0;
}
+int
+iot_fgetxattr_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_fgetxattr_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name)
+{
+ STACK_WIND (frame, iot_fgetxattr_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->fgetxattr, fd, name);
+ return 0;
+}
+
+int
+iot_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_fgetxattr_stub (frame, iot_fgetxattr_wrapper, fd, name);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get fgetxattr stub");
+ STACK_UNWIND (frame, -1, ENOMEM, NULL);
+ return 0;
+ }
+
+ iot_schedule_ordered ((iot_conf_t *)this->private, fd->inode, stub);
+ return 0;
+}
/* Must be called with worker lock held */
void
@@ -2208,6 +2241,7 @@ struct xlator_fops fops = {
.statfs = iot_statfs, /* U */
.setxattr = iot_setxattr, /* U */
.getxattr = iot_getxattr, /* U */
+ .fgetxattr = iot_fgetxattr, /* O */
};
struct xlator_mops mops = {