From d56683ccfa1b53c42717ff36490066cff25fd7d0 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 1 Apr 2009 13:55:19 -0700 Subject: io-threads: Wire in support for fchmod fop Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.c | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'xlators/performance/io-threads') diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index a3ba4789e..07437f041 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -137,6 +137,48 @@ iot_chmod (call_frame_t *frame, return 0; } +int32_t +iot_fchmod_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_fchmod_wrapper (call_frame_t *frame, + xlator_t *this, + fd_t *fd, + mode_t mode) +{ + STACK_WIND (frame, iot_fchmod_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->fchmod, fd, mode); + return 0; +} + +int32_t +iot_fchmod (call_frame_t *frame, + xlator_t *this, + fd_t *fd, + mode_t mode) +{ + call_stub_t *stub = NULL; + + stub = fop_fchmod_stub (frame, iot_fchmod_wrapper, fd, mode); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR, "cannot get fchmod stub"); + STACK_UNWIND (frame, -1, ENOMEM, NULL); + return 0; + } + + iot_schedule ((iot_conf_t *)this->private, fd->inode, stub); + return 0; +} + int32_t iot_open_cbk (call_frame_t *frame, void *cookie, @@ -1047,6 +1089,7 @@ struct xlator_fops fops = { .unlink = iot_unlink, .lookup = iot_lookup, .chmod = iot_chmod, + .fchmod = iot_fchmod, }; struct xlator_mops mops = { -- cgit