summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-01 13:55:44 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-02 19:18:40 +0530
commit3ca0a7859f6f8f7ebc6ac32b6f17035f2115d2a0 (patch)
treea59c571d1a494bf224fad752be18ed1c16485136 /xlators/performance/io-threads
parentd56683ccfa1b53c42717ff36490066cff25fd7d0 (diff)
io-threads: Wire in support for chown
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.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 07437f04115..f05f99a24fe 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -180,6 +180,51 @@ iot_fchmod (call_frame_t *frame,
}
int32_t
+iot_chown_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_chown_wrapper (call_frame_t *frame,
+ xlator_t *this,
+ loc_t *loc,
+ uid_t uid,
+ gid_t gid)
+{
+ STACK_WIND (frame, iot_chown_cbk, FIRST_CHILD (this),
+ FIRST_CHILD (this)->fops->chown, loc, uid, gid);
+ return 0;
+}
+
+int32_t
+iot_chown (call_frame_t *frame,
+ xlator_t *this,
+ loc_t *loc,
+ uid_t uid,
+ gid_t gid)
+{
+ call_stub_t *stub = NULL;
+
+ stub = fop_chown_stub (frame, iot_chown_wrapper, loc, uid, gid);
+ if (!stub) {
+ gf_log (this->name, GF_LOG_ERROR, "cannot get chown 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,
@@ -1090,6 +1135,7 @@ struct xlator_fops fops = {
.lookup = iot_lookup,
.chmod = iot_chmod,
.fchmod = iot_fchmod,
+ .chown = iot_chown,
};
struct xlator_mops mops = {