diff options
author | Muthu-vigneshwaran <mvignesh@redhat.com> | 2016-08-22 16:53:59 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-08-25 05:18:59 -0700 |
commit | e68a8eb6c5846d7386e97b0f0f23b49c5d38a6b5 (patch) | |
tree | 26f2926d23db2258e407075c4085f33ea1453a30 /xlators | |
parent | c68b561f048a02f479819b1c9cb3b5b896db18a6 (diff) |
quota: add quota events
The patch targets to capture quota related events which are
important to be notified.
Change-Id: Iba440d675b11c346faab4c23260899d05296d8a7
BUG: 1368931
Signed-off-by: Muthu-vigneshwaran <mvignesh@redhat.com>
Reviewed-on: http://review.gluster.org/15235
Smoke: Gluster Build System <jenkins@build.gluster.org>
Tested-by: Manikandan Selvaganesh <mselvaga@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/quota/src/quota.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 06007fb0aff..350e8ac8de0 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -15,6 +15,7 @@ #include "statedump.h" #include "quota-common-utils.h" #include "quota-messages.h" +#include "events.h" struct volume_options options[]; @@ -5008,7 +5009,12 @@ quota_log_usage (xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode, gf_msg (this->name, GF_LOG_ALERT, 0, Q_MSG_CROSSED_SOFT_LIMIT, "Usage crossed soft limit: " "%s used by %s", usage_str, path); + + gf_event (EVENT_QUOTA_CROSSED_SOFT_LIMIT, "Usage=%s;volume=%s;" + "path=%s", usage_str, priv->volume_uuid, path); + ctx->prev_log = cur_time; + } /* Usage is above soft limit */ else if (cur_size > ctx->soft_lim && @@ -5020,6 +5026,10 @@ quota_log_usage (xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode, gf_msg (this->name, GF_LOG_ALERT, 0, Q_MSG_CROSSED_SOFT_LIMIT, "Usage is above soft limit: %s used by %s", usage_str, path); + + gf_event (EVENT_QUOTA_CROSSED_SOFT_LIMIT, "Usage=%s;volume=%s;" + "path=%s", usage_str, priv->volume_uuid, path); + ctx->prev_log = cur_time; } |