From 24ec0fbc4bd145b93b80afa480d5cb4cf785717e Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 1 Oct 2010 08:01:14 +0000 Subject: stat enhancements * dht to send 'setxattr' to all subvolumes in the layout * server dumps info on total bytes read/written for 'trusted.io.stat.dump' key * server dumps all the mount point IP for 'trusted.list.mount.point' key. * io-stats dumps latency information only if measured Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1701 (better statistics gathering in glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1701 --- xlators/cluster/dht/src/dht-common.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 0a39084a177..a262ba6ca67 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1938,10 +1938,12 @@ int dht_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr, int flags) { - xlator_t *subvol = NULL; - int op_errno = -1; - dht_local_t *local = NULL; - + xlator_t *subvol = NULL; + dht_local_t *local = NULL; + dht_conf_t *conf = NULL; + dht_layout_t *layout = NULL; + int i = 0; + int op_errno = EINVAL; VALIDATE_OR_GOTO (frame, err); VALIDATE_OR_GOTO (this, err); @@ -1949,6 +1951,7 @@ dht_setxattr (call_frame_t *frame, xlator_t *this, VALIDATE_OR_GOTO (loc->inode, err); VALIDATE_OR_GOTO (loc->path, err); + conf = this->private; subvol = dht_subvol_get_cached (this, loc->inode); if (!subvol) { gf_log (this->name, GF_LOG_DEBUG, @@ -1965,11 +1968,22 @@ dht_setxattr (call_frame_t *frame, xlator_t *this, goto err; } - local->call_cnt = 1; + local->layout = layout = dht_layout_get (this, loc->inode); + if (!layout) { + gf_log (this->name, GF_LOG_DEBUG, + "no layout for path=%s", loc->path); + op_errno = EINVAL; + goto err; + } - STACK_WIND (frame, dht_err_cbk, - subvol, subvol->fops->setxattr, - loc, xattr, flags); + local->call_cnt = layout->cnt; + + for (i = 0; i < layout->cnt; i++) { + STACK_WIND (frame, dht_err_cbk, + layout->list[i].xlator, + layout->list[i].xlator->fops->setxattr, + loc, xattr, flags); + } return 0; -- cgit