summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-layout.c
diff options
context:
space:
mode:
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;