From 49c325d949b2df06572df7dd3825735fb9c8cd6f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sat, 21 Jan 2012 20:05:55 +0530 Subject: complete the implementation of missing 'f**xattr()' fops in debug/* and cluster/* translators and a syncop_fsetxattr() added a test case for testing the working of 'f-fop()' on fuse mount. Change-Id: I0c2aeeb30a0fb382ef2495cca1e66b00abaffd35 Signed-off-by: Amar Tumballi BUG: 766571 Reviewed-on: http://review.gluster.com/802 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/debug/io-stats/src/io-stats.c | 76 +++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) (limited to 'xlators/debug/io-stats/src/io-stats.c') diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 923470b87..e47b062ee 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -1636,6 +1636,35 @@ io_stats_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, return 0; } +int +io_stats_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno) +{ + UPDATE_PROFILE_STATS (frame, FSETXATTR); + STACK_UNWIND_STRICT (fsetxattr, frame, op_ret, op_errno); + return 0; +} + + +int +io_stats_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno, dict_t *dict) +{ + UPDATE_PROFILE_STATS (frame, FGETXATTR); + STACK_UNWIND_STRICT (fgetxattr, frame, op_ret, op_errno, dict); + return 0; +} + + +int +io_stats_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int32_t op_ret, int32_t op_errno) +{ + UPDATE_PROFILE_STATS (frame, FREMOVEXATTR); + STACK_UNWIND_STRICT (fremovexattr, frame, op_ret, op_errno); + return 0; +} + int io_stats_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, @@ -2204,6 +2233,50 @@ io_stats_removexattr (call_frame_t *frame, xlator_t *this, } +int +io_stats_fsetxattr (call_frame_t *frame, xlator_t *this, + fd_t *fd, dict_t *dict, + int32_t flags) +{ + START_FOP_LATENCY (frame); + + STACK_WIND (frame, io_stats_fsetxattr_cbk, + FIRST_CHILD(this), + FIRST_CHILD(this)->fops->fsetxattr, + fd, dict, flags); + return 0; +} + + +int +io_stats_fgetxattr (call_frame_t *frame, xlator_t *this, + fd_t *fd, const char *name) +{ + START_FOP_LATENCY (frame); + + STACK_WIND (frame, io_stats_fgetxattr_cbk, + FIRST_CHILD(this), + FIRST_CHILD(this)->fops->fgetxattr, + fd, name); + return 0; +} + + +int +io_stats_fremovexattr (call_frame_t *frame, xlator_t *this, + fd_t *fd, const char *name) +{ + START_FOP_LATENCY (frame); + + STACK_WIND (frame, io_stats_fremovexattr_cbk, + FIRST_CHILD(this), + FIRST_CHILD(this)->fops->fremovexattr, + fd, name); + + return 0; +} + + int io_stats_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd) @@ -2681,6 +2754,9 @@ struct xlator_fops fops = { .setxattr = io_stats_setxattr, .getxattr = io_stats_getxattr, .removexattr = io_stats_removexattr, + .fsetxattr = io_stats_fsetxattr, + .fgetxattr = io_stats_fgetxattr, + .fremovexattr = io_stats_fremovexattr, .opendir = io_stats_opendir, .readdir = io_stats_readdir, .readdirp = io_stats_readdirp, -- cgit