diff options
author | Amar Tumballi <amar@gluster.com> | 2010-10-01 08:01:14 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-01 09:33:50 -0700 |
commit | 24ec0fbc4bd145b93b80afa480d5cb4cf785717e (patch) | |
tree | 2122d11aab686dae4d439aecd0e543be33c11feb /xlators/cluster/dht | |
parent | a3f90eeb0ad97e4f86aef603f95b0562ab18f36d (diff) |
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 <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1701 (better statistics gathering in glusterd)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1701
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 30 |
1 files changed, 22 insertions, 8 deletions
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; |