summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-transaction.c
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-03-06 12:33:05 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-27 05:25:05 -0700
commit58a736111fa1db4f10c6646e81066434260f674f (patch)
tree98b40c45c6510c0ca9a9a33062b46b0411815556 /xlators/cluster/afr/src/afr-transaction.c
parent7a3736b4a46dd07d65e27d892a85299a37fdd9a2 (diff)
afr: Porting messages to new logging framework
updated Change-Id: I94ac7b2cb0d43a82cf0eeee21407cff9b575c458 BUG: 1194640 Signed-off-by: arao <arao@redhat.com> Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com> Reviewed-on: http://review.gluster.org/9897 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-transaction.c')
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index b27cfedaddb..ba50abd6d38 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -16,6 +16,8 @@
#include "afr.h"
#include "afr-transaction.h"
#include "afr-self-heal.h"
+#include "afr-messages.h"
+
#include <signal.h>
gf_boolean_t
@@ -1220,13 +1222,14 @@ afr_post_blocking_inodelk_cbk (call_frame_t *frame, xlator_t *this)
int_lock = &local->internal_lock;
if (int_lock->lock_op_ret < 0) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO,
+ 0, AFR_MSG_BLOCKING_LKS_FAILED,
"Blocking inodelks failed.");
local->transaction.done (frame, this);
} else {
- gf_log (this->name, GF_LOG_DEBUG,
- "Blocking inodelks done. Proceeding to FOP");
+ gf_msg_debug (this->name, 0,
+ "Blocking inodelks done. Proceeding to FOP");
afr_internal_lock_finish (frame, this);
}
@@ -1245,14 +1248,14 @@ afr_post_nonblocking_inodelk_cbk (call_frame_t *frame, xlator_t *this)
/* Initiate blocking locks if non-blocking has failed */
if (int_lock->lock_op_ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG,
- "Non blocking inodelks failed. Proceeding to blocking");
+ gf_msg_debug (this->name, 0,
+ "Non blocking inodelks failed. Proceeding to blocking");
int_lock->lock_cbk = afr_post_blocking_inodelk_cbk;
afr_blocking_lock (frame, this);
} else {
- gf_log (this->name, GF_LOG_DEBUG,
- "Non blocking inodelks done. Proceeding to FOP");
+ gf_msg_debug (this->name, 0,
+ "Non blocking inodelks done. Proceeding to FOP");
afr_internal_lock_finish (frame, this);
}
@@ -1270,13 +1273,14 @@ afr_post_blocking_entrylk_cbk (call_frame_t *frame, xlator_t *this)
int_lock = &local->internal_lock;
if (int_lock->lock_op_ret < 0) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ AFR_MSG_BLOCKING_LKS_FAILED,
"Blocking entrylks failed.");
local->transaction.done (frame, this);
} else {
- gf_log (this->name, GF_LOG_DEBUG,
- "Blocking entrylks done. Proceeding to FOP");
+ gf_msg_debug (this->name, 0,
+ "Blocking entrylks done. Proceeding to FOP");
afr_internal_lock_finish (frame, this);
}
@@ -1295,14 +1299,15 @@ afr_post_nonblocking_entrylk_cbk (call_frame_t *frame, xlator_t *this)
/* Initiate blocking locks if non-blocking has failed */
if (int_lock->lock_op_ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG,
- "Non blocking entrylks failed. Proceeding to blocking");
+ gf_msg_debug (this->name, 0,
+ "Non blocking entrylks failed. Proceeding to blocking");
int_lock->lock_cbk = afr_post_blocking_entrylk_cbk;
afr_blocking_lock (frame, this);
} else {
- gf_log (this->name, GF_LOG_DEBUG,
- "Non blocking entrylks done. Proceeding to FOP");
+ gf_msg_debug (this->name, 0,
+ "Non blocking entrylks done. Proceeding to FOP");
+
afr_internal_lock_finish (frame, this);
}
@@ -1320,13 +1325,16 @@ afr_post_blocking_rename_cbk (call_frame_t *frame, xlator_t *this)
int_lock = &local->internal_lock;
if (int_lock->lock_op_ret < 0) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ AFR_MSG_BLOCKING_LKS_FAILED,
"Blocking entrylks failed.");
+
local->transaction.done (frame, this);
} else {
- gf_log (this->name, GF_LOG_DEBUG,
- "Blocking entrylks done. Proceeding to FOP");
+ gf_msg_debug (this->name, 0,
+ "Blocking entrylks done. Proceeding to FOP");
+
afr_internal_lock_finish (frame, this);
}
return 0;
@@ -1477,7 +1485,8 @@ afr_are_multiple_fds_opened (fd_t *fd, xlator_t *this)
/* If false is returned, it may keep on taking eager-lock
* which may lead to starvation, so return true to avoid that.
*/
- gf_log_callingfn (this->name, GF_LOG_ERROR, "Invalid fd");
+ gf_msg_callingfn (this->name, GF_LOG_ERROR, EBADF,
+ AFR_MSG_INVALID_ARG, "Invalid fd");
return _gf_true;
}
/* Lets say mount1 has eager-lock(full-lock) and after the eager-lock
@@ -1597,7 +1606,8 @@ afr_changelog_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* Failure of fsync() is as good as failure of previous
write(). So treat it like one.
*/
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING,
+ op_errno, AFR_MSG_FSYNC_FAILED,
"fsync(%s) failed on subvolume %s. Transaction was %s",
uuid_utoa (local->fd->inode->gfid),
priv->children[child_index]->name,