diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-21 04:49:24 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-22 13:06:31 +0530 |
commit | d1eb9b13d2e50485e69301ade12afe5ea8636af8 (patch) | |
tree | 3f9ea7499d3a1b6acde55c482900b5a599950a3f /xlators/performance/io-threads/src/io-threads.c | |
parent | 609c5aff6faa21cf3aaefa6b7a2a31a91590d726 (diff) |
io-threads: Add removexattr 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.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 363a64929..f0207f986 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1748,6 +1748,50 @@ iot_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, iot_schedule_ordered ((iot_conf_t *)this->private, fd->inode, stub); return 0; } + +int +iot_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno) +{ + STACK_UNWIND (frame, op_ret, op_errno); + return 0; +} + +int +iot_removexattr_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc, + const char *name) +{ + STACK_WIND (frame, iot_removexattr_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->removexattr, loc, name); + return 0; +} + +int +iot_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc, + const char *name) +{ + call_stub_t *stub = NULL; + fd_t *fd = NULL; + + stub = fop_removexattr_stub (frame, iot_removexattr_wrapper, loc, + name); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR,"cannot get removexattr fop"); + 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, @@ -2277,6 +2321,7 @@ struct xlator_fops fops = { .getxattr = iot_getxattr, /* U */ .fgetxattr = iot_fgetxattr, /* O */ .fsetxattr = iot_fsetxattr, /* O */ + .removexattr = iot_removexattr, /* U */ }; struct xlator_mops mops = { |