summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2012-01-17 05:57:24 +0530
committerAnand Avati <avati@gluster.com>2012-01-25 02:24:20 -0800
commitd7ecaaa1ed0f88869812ea17cb64a102a74c8c1c (patch)
tree4293106362bf9dec2e6260a4062239a9b7340cc0 /xlators/performance/io-threads
parent6c54022f1b1c7f5f458f6a7e783203d11e7f89b5 (diff)
core: add 'fremovexattr()' fop
so operations can be done on fd for extended attribute removal Change-Id: Ie026f1b53793aeb4ae33e96ea5408c7a97f34bf6 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 766571 Reviewed-on: http://review.gluster.com/778 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/performance/io-threads')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index e4077478182..2402f86d9f6 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -240,6 +240,7 @@ iot_schedule (call_frame_t *frame, xlator_t *this, call_stub_t *stub)
case GF_FOP_FGETXATTR:
case GF_FOP_FSETXATTR:
case GF_FOP_REMOVEXATTR:
+ case GF_FOP_FREMOVEXATTR:
pri = IOT_PRI_NORMAL;
break;
@@ -1828,6 +1829,53 @@ out:
return 0;
}
+int
+iot_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno)
+{
+ STACK_UNWIND_STRICT (fremovexattr, frame, op_ret, op_errno);
+ return 0;
+}
+
+
+int
+iot_fremovexattr_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name)
+{
+ STACK_WIND (frame, iot_fremovexattr_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->fremovexattr, fd, name);
+ return 0;
+}
+
+
+int
+iot_fremovexattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name)
+{
+ call_stub_t *stub = NULL;
+ int ret = -1;
+
+ stub = fop_fremovexattr_stub (frame, iot_fremovexattr_wrapper, fd,
+ name);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR,"cannot get fremovexattr fop"
+ "(out of memory)");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = iot_schedule (frame, this, stub);
+out:
+ if (ret < 0) {
+ STACK_UNWIND_STRICT (fremovexattr, frame, -1, -ret);
+
+ if (stub != NULL) {
+ call_stub_destroy (stub);
+ }
+ }
+ return 0;
+}
+
int
iot_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -2512,6 +2560,7 @@ struct xlator_fops fops = {
.fgetxattr = iot_fgetxattr,
.fsetxattr = iot_fsetxattr,
.removexattr = iot_removexattr,
+ .fremovexattr = iot_fremovexattr,
.readdir = iot_readdir,
.readdirp = iot_readdirp,
.inodelk = iot_inodelk,