From a77340b94147a078918536a5297746803c846809 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 21 Apr 2009 04:48:56 -0700 Subject: io-threads: Add fgetxattr 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 ebd074faa..11aa7bb51 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1680,6 +1680,39 @@ iot_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; } +int +iot_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, dict_t *dict) +{ + STACK_UNWIND (frame, op_ret, op_errno, dict); + return 0; +} + +int +iot_fgetxattr_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd, + const char *name) +{ + STACK_WIND (frame, iot_fgetxattr_cbk, FIRST_CHILD (this), + FIRST_CHILD (this)->fops->fgetxattr, fd, name); + return 0; +} + +int +iot_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, + const char *name) +{ + call_stub_t *stub = NULL; + + stub = fop_fgetxattr_stub (frame, iot_fgetxattr_wrapper, fd, name); + if (!stub) { + gf_log (this->name, GF_LOG_ERROR, "cannot get fgetxattr stub"); + STACK_UNWIND (frame, -1, ENOMEM, NULL); + return 0; + } + + iot_schedule_ordered ((iot_conf_t *)this->private, fd->inode, stub); + return 0; +} /* Must be called with worker lock held */ void @@ -2208,6 +2241,7 @@ struct xlator_fops fops = { .statfs = iot_statfs, /* U */ .setxattr = iot_setxattr, /* U */ .getxattr = iot_getxattr, /* U */ + .fgetxattr = iot_fgetxattr, /* O */ }; struct xlator_mops mops = { -- cgit