summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-rebalance.c
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-06-12 16:35:53 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-07-27 00:21:48 -0700
commit73517fedf7840363b9f688183e604a617d934652 (patch)
treeaf6e03acd0d45a81b555cd8c0a123c3baa5fbd0e /xlators/cluster/dht/src/dht-rebalance.c
parent5ebf298ec03bc929a4142e70ed105130cf9c58df (diff)
dht: Adding log messages to the new logging framework
Backported from: http://review.gluster.org/10021 > Change-Id: Ib3bb61c5223f409c23c68100f3fe884918d2dc3f > BUG: 1194640 > Reviewed-on: http://review.gluster.org/10021 > Reviewed-by: N Balachandran <nbalacha@redhat.com> > Reviewed-by: Joseph Fernandes <josferna@redhat.com> > Tested-by: Joseph Fernandes <josferna@redhat.com> > Reviewed-by: Dan Lambright <dlambrig@redhat.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Tested-by: Raghavendra G <rgowdapp@redhat.com> > Signed-off-by: arao <arao@redhat.com> BUG: 1217722 Change-Id: Ide79c6c1e6a466fb52f955c90a2b22711bec794a Signed-off-by: arao <arao@redhat.com> Signed-off-by: Anusha Rao <arao@redhat.com> Reviewed-on: http://review.gluster.org/11350 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rebalance.c')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 4db6134b8f9..bf9df40a933 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -313,7 +313,9 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t *xattrs,
} else {
linkto_subvol = dht_linkfile_subvol (this, NULL, NULL, xattrs);
if (!linkto_subvol) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to get "
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ DHT_MSG_SUBVOL_ERROR,
+ "Failed to get "
"linkto subvol for %s", loc->name);
} else {
hashed_subvol = linkto_subvol;
@@ -326,10 +328,12 @@ gf_defrag_handle_hardlink (xlator_t *this, loc_t *loc, dict_t *xattrs,
loglevel = (op_errno == EEXIST) ? GF_LOG_DEBUG : \
GF_LOG_ERROR;
- gf_log (this->name, loglevel, "link of %s -> %s"
- " failed on subvol %s (%s)", loc->name,
+ gf_msg (this->name, loglevel, op_errno,
+ DHT_MSG_MIGRATE_HARDLINK_FILE_FAILED,
+ "link of %s -> %s"
+ " failed on subvol %s", loc->name,
uuid_utoa(loc->gfid),
- hashed_subvol->name, strerror (op_errno));
+ hashed_subvol->name);
if (op_errno != EEXIST)
goto out;
}
@@ -585,7 +589,8 @@ __dht_check_free_space (xlator_t *to, xlator_t *from, loc_t *loc,
xdata = dict_new ();
if (!xdata) {
errno = ENOMEM;
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
+ DHT_MSG_NO_MEMORY,
"failed to allocate dictionary");
goto out;
}
@@ -1407,9 +1412,10 @@ gf_listener_stop (xlator_t *this)
}
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to unlink listener "
- "socket %s, error: %s", cmd_args->sock_file,
- strerror (errno));
+ gf_msg (this->name, GF_LOG_ERROR, errno,
+ DHT_MSG_SOCKET_ERROR,
+ "Failed to unlink listener "
+ "socket %s", cmd_args->sock_file);
}
return ret;
}
@@ -1766,8 +1772,8 @@ gf_defrag_task (void *opaque)
iterator = list_entry (q_head->next,
typeof(*iterator), list);
- gf_log ("DHT", GF_LOG_DEBUG, "picking entry "
- "%s", iterator->df_entry->d_name);
+ gf_msg_debug ("DHT", 0, "picking entry "
+ "%s", iterator->df_entry->d_name);
list_del_init (&(iterator->list));
@@ -1969,9 +1975,9 @@ gf_defrag_get_entry (xlator_t *this, int i, struct dht_container **container,
migration. Only the actual data file need to
be checked for migration criteria.
*/
- gf_log (this->name, GF_LOG_DEBUG, "Skipping linkfile"
- " %s on subvol: %s", entry_loc.path,
- conf->local_subvols[i]->name);
+ gf_msg_debug (this->name, 0, "Skipping linkfile"
+ " %s on subvol: %s", entry_loc.path,
+ conf->local_subvols[i]->name);
continue;
}
@@ -2305,10 +2311,10 @@ gf_defrag_process_dir (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,
defrag->q_entry_count++;
ldfq_count = defrag->q_entry_count;
- gf_log (this->name, GF_LOG_DEBUG, "added "
- "file:%s parent:%s to the queue ",
- container->df_entry->d_name,
- container->parent_loc->path);
+ gf_msg_debug (this->name, 0, "added "
+ "file:%s parent:%s to the queue ",
+ container->df_entry->d_name,
+ container->parent_loc->path);
pthread_cond_signal (
&defrag->parallel_migration_cond);
@@ -2743,8 +2749,8 @@ gf_defrag_start_crawl (void *data)
thread_spawn_count = MAX ((sysconf(_SC_NPROCESSORS_ONLN) - 4), 4);
- gf_log (this->name, GF_LOG_DEBUG, "thread_spawn_count: %d",
- thread_spawn_count);
+ gf_msg_debug (this->name, 0, "thread_spawn_count: %d",
+ thread_spawn_count);
defrag->current_thread_count = thread_spawn_count;