From d769066ddcb7b3fab456a57704b184d0617b8d52 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 21 Apr 2009 04:48:08 -0700 Subject: io-threads: Add fsyncdir fop Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.c | 34 +++++++++++++++++++++++++ 1 file changed, 34 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 1dc6094d4..a71273646 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 = { -- cgit