summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-layout.c
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-06-12 16:35:53 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-06-23 22:15:10 -0700
commit2b645af1d077957829c8ff6b8ab56353ba3913d6 (patch)
treefe399a98df744440783a1eec00d6ff9c77ab533f /xlators/cluster/dht/src/dht-layout.c
parent653d3c1406e372aabcf694bfead2d695f84ee0f8 (diff)
dht: Adding log messages to the new logging framework
Change-Id: Ib3bb61c5223f409c23c68100f3fe884918d2dc3f BUG: 1194640 Signed-off-by: arao <arao@redhat.com> Reviewed-on: http://review.gluster.org/10021 Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Joseph Fernandes Tested-by: Joseph Fernandes Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-layout.c')
-rw-r--r--xlators/cluster/dht/src/dht-layout.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c
index 103a7f8d637..1bdad65b70f 100644
--- a/xlators/cluster/dht/src/dht-layout.c
+++ b/xlators/cluster/dht/src/dht-layout.c
@@ -165,7 +165,8 @@ dht_layout_search (xlator_t *this, dht_layout_t *layout, const char *name)
ret = dht_hash_compute (this, layout->type, name, &hash);
if (ret != 0) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ DHT_MSG_COMPUTE_HASH_FAILED,
"hash computation failed for type=%d name=%s",
layout->type, name);
goto out;
@@ -180,7 +181,8 @@ dht_layout_search (xlator_t *this, dht_layout_t *layout, const char *name)
}
if (!subvol) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ DHT_MSG_HASHED_SUBVOL_GET_FAILED,
"no subvolume for hash (value) = %u", hash);
}
@@ -663,7 +665,8 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout)
ret = dht_layout_sort (layout);
if (ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ DHT_MSG_LAYOUT_SORT_FAILED,
"sort failed?! how the ....");
goto out;
}
@@ -674,7 +677,8 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout)
&holes, &overlaps,
&missing, &down, &misc, NULL);
if (ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ DHT_MSG_FIND_LAYOUT_ANOMALIES_ERROR,
"Error finding anomalies in %s, gfid = %s",
loc->path, gfid);
goto out;
@@ -686,7 +690,8 @@ dht_layout_normalize (xlator_t *this, loc_t *loc, dht_layout_t *layout)
"Directory %s looked up first time"
" gfid = %s", loc->path, gfid);
} else {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_ANOMALIES_INFO,
"Found anomalies in %s (gfid = %s). "
"Holes=%d overlaps=%d",
loc->path, gfid, holes, overlaps );
@@ -759,11 +764,13 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
if (!xattr) {
if (err == 0) {
if (loc) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_DICT_GET_FAILED,
"%s: xattr dictionary is NULL",
loc->path);
} else {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_DICT_GET_FAILED,
"path not found: "
"xattr dictionary is NULL");
}
@@ -778,11 +785,13 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
if (dict_ret < 0) {
if (err == 0 && layout->list[pos].stop) {
if (loc) {
- gf_log (this->name, GF_LOG_INFO,
- "%s: Disk layout missing, gfid = %s",
- loc->path, gfid);
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_DISK_LAYOUT_MISSING,
+ "%s: Disk layout missing, gfid = %s",
+ loc->path, gfid);
} else {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_DISK_LAYOUT_MISSING,
"path not found: "
"Disk layout missing, gfid = %s",
gfid);
@@ -801,7 +810,8 @@ dht_layout_dir_mismatch (xlator_t *this, dht_layout_t *layout, xlator_t *subvol,
if ((layout->list[pos].start != start_off)
|| (layout->list[pos].stop != stop_off)
|| (layout->list[pos].commit_hash != commit_hash)) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_LAYOUT_INFO,
"subvol: %s; inode layout - %"PRIu32" - %"PRIu32
" - %"PRIu32"; "
"disk layout - %"PRIu32" - %"PRIu32" - %"PRIu32,
@@ -831,7 +841,8 @@ dht_layout_preset (xlator_t *this, xlator_t *subvol, inode_t *inode)
layout = dht_layout_for_subvol (this, subvol);
if (!layout) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_SUBVOL_NO_LAYOUT_INFO,
"no pre-set layout for subvolume %s",
subvol ? subvol->name : "<nil>");
ret = -1;