diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-04-21 04:48:08 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-22 13:06:30 +0530 |
commit | d769066ddcb7b3fab456a57704b184d0617b8d52 (patch) | |
tree | 005fa74aae34edcfa552a8fa986f82a43b6e98e9 /xlators/performance/io-threads | |
parent | 282a39c19ee15f8908eb28f0b2d6983b665d57a7 (diff) |
io-threads: Add fsyncdir 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.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 1dc6094d..a7127364 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1529,6 +1529,39 @@ iot_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd) return 0; } +int +iot_fsyncdir_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_fsyncdir_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd, + int datasync) +{ + STACK_WIND (frame, iot_fsyncdir_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->fsyncdir, fd, datasync); + return 0; +} + +int +iot_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync) +{ + call_stub_t *stub = NULL; + + stub = fop_fsyncdir_stub (frame, iot_fsyncdir_wrapper, fd, datasync); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR, "cannot get fsyncdir stub"); + STACK_UNWIND (frame, -1, ENOMEM); + return 0; + } + + iot_schedule_ordered ((iot_conf_t *)this->private, fd->inode, stub); + return 0; +} + /* Must be called with worker lock held */ void _iot_queue (iot_worker_t *worker, @@ -2052,6 +2085,7 @@ struct xlator_fops fops = { .rename = iot_rename, /* U */ .link = iot_link, /* U */ .opendir = iot_opendir, /* U */ + .fsyncdir = iot_fsyncdir, /* O */ }; struct xlator_mops mops = { |