summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 13:54:52 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:18:33 +0530
commitf05ca55ef77fb2004b0f573aa267c92405166d9c (patch)
tree58206036ec47e6da56d2fa36411a41d2c6c76d09 /xlators/performance/io-threads
parentdffa5a92c70732e790b6c789e2aacb7f8c5c34cc (diff)
io-threads: Wire in support for chmod fop
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index d7a5db99dbc..a3ba4789ea1 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -97,6 +97,47 @@ iot_lookup (call_frame_t *frame,
}
int32_t
+iot_chmod_cbk (call_frame_t *frame,
+ void *cookie,
+ xlator_t *this,
+ int32_t op_ret,
+ int32_t op_errno,
+ struct stat *buf)
+{
+ STACK_UNWIND (frame, op_ret, op_errno, buf);
+ return 0;
+}
+
+int32_t
+iot_chmod_wrapper (call_frame_t *frame,
+ xlator_t *this,
+ loc_t *loc,
+ mode_t mode)
+{
+ STACK_WIND (frame, iot_chmod_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->chmod, loc, mode);
+ return 0;
+}
+
+int32_t
+iot_chmod (call_frame_t *frame,
+ xlator_t *this,
+ loc_t *loc,
+ mode_t mode)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_chmod_stub (frame, iot_chmod_wrapper, loc, mode);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get chmod stub");
+ STACK_UNWIND (frame, -1, ENOMEM, NULL);
+ return 0;
+ }
+ iot_schedule ((iot_conf_t *)this->private, loc->inode, stub);
+ return 0;
+}
+
+int32_t
iot_open_cbk (call_frame_t *frame,
void *cookie,
xlator_t *this,
@@ -1005,6 +1046,7 @@ struct xlator_fops fops = {
.checksum = iot_checksum,
.unlink = iot_unlink,
.lookup = iot_lookup,
+ .chmod = iot_chmod,
};
struct xlator_mops mops = {