diff options
author | arao <arao@redhat.com> | 2015-06-12 16:35:53 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-06-23 22:15:10 -0700 |
commit | 2b645af1d077957829c8ff6b8ab56353ba3913d6 (patch) | |
tree | fe399a98df744440783a1eec00d6ff9c77ab533f /xlators/cluster/dht/src/nufa.c | |
parent | 653d3c1406e372aabcf694bfead2d695f84ee0f8 (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/nufa.c')
-rw-r--r-- | xlators/cluster/dht/src/nufa.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c index 43519d97542..56e17d6e884 100644 --- a/xlators/cluster/dht/src/nufa.c +++ b/xlators/cluster/dht/src/nufa.c @@ -201,7 +201,8 @@ nufa_lookup (call_frame_t *frame, xlator_t *this, ret = dict_set_uint32 (local->xattr_req, conf->xattr_name, 4 * 4); if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_DICT_SET_FAILED, "Failed to set dict value."); op_errno = -1; goto err; @@ -222,7 +223,8 @@ nufa_lookup (call_frame_t *frame, xlator_t *this, ret = dict_set_uint32 (local->xattr_req, conf->xattr_name, 4 * 4); if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_DICT_SET_FAILED, "Failed to set dict value."); op_errno = -1; goto err; @@ -231,7 +233,8 @@ nufa_lookup (call_frame_t *frame, xlator_t *this, ret = dict_set_uint32 (local->xattr_req, conf->link_xattr_name, 256); if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_DICT_SET_FAILED, "Failed to set dict value."); op_errno = -1; goto err; @@ -503,7 +506,9 @@ nufa_find_local_brick (xlator_t *xl, void *data) if (strcmp (xl->name, local_volname) == 0) { conf->private = xl; - gf_log (this->name, GF_LOG_INFO, "Using specified subvol %s", + gf_msg (this->name, GF_LOG_INFO, 0, + DHT_MSG_SUBVOL_INFO, + "Using specified subvol %s", local_volname); return; } @@ -516,7 +521,8 @@ nufa_find_local_brick (xlator_t *xl, void *data) (gf_is_same_address (local_volname, brick_host) || gf_is_local_addr (brick_host))) { conf->private = xl; - gf_log (this->name, GF_LOG_INFO, "Using the first local " + gf_msg (this->name, GF_LOG_INFO, 0, + DHT_MSG_SUBVOL_INFO, "Using the first local " "subvol %s", xl->name); return; } @@ -546,7 +552,8 @@ nufa_find_local_subvol (xlator_t *this, xlator_foreach_depth_first (this, fn, data); if (!conf->private) { - gf_log (this->name, GF_LOG_ERROR, "Couldn't find a local " + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_BRICK_ERROR, "Couldn't find a local " "brick"); return -1; } @@ -557,7 +564,8 @@ nufa_find_local_subvol (xlator_t *this, parent = trav->xlator; if (strcmp (parent->type, "cluster/nufa") == 0) { - gf_log (this->name, GF_LOG_INFO, "Found local subvol, " + gf_msg (this->name, GF_LOG_INFO, 0, + DHT_MSG_SUBVOL_INFO, "Found local subvol, " "%s", candidate->name); ret = 0; conf->private = candidate; @@ -597,9 +605,9 @@ nufa_init (xlator_t *this) local_volname = my_hostname; else - gf_log (this->name, GF_LOG_WARNING, - "could not find hostname (%s)", - strerror (errno)); + gf_msg (this->name, GF_LOG_WARNING, errno, + DHT_MSG_GET_HOSTNAME_FAILED, + "could not find hostname"); } @@ -608,7 +616,8 @@ nufa_init (xlator_t *this) args.addr_match = addr_match; ret = nufa_find_local_subvol (this, nufa_find_local_brick, &args); if (ret) { - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, + DHT_MSG_SUBVOL_INFO, "Unable to find local subvolume, switching " "to dht mode"); nufa_to_dht (this); |