From 2b9b3ef3b646989bbc0412dca187b3f5fcad3283 Mon Sep 17 00:00:00 2001 From: Mohamed Ashiq Date: Tue, 19 May 2015 15:46:01 +0530 Subject: mem-pool,stack,store,syncop,timer/libglusterfs : Porting to a new logging framework Change-Id: Idd3dcaf7eeea5207b3a5210676ce3df64153197f BUG: 1194640 Signed-off-by: Mohamed Ashiq Reviewed-on: http://review.gluster.org/10827 Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System --- libglusterfs/src/syncop-utils.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'libglusterfs/src/syncop-utils.c') diff --git a/libglusterfs/src/syncop-utils.c b/libglusterfs/src/syncop-utils.c index 81393136abb..ce60ef0c153 100644 --- a/libglusterfs/src/syncop-utils.c +++ b/libglusterfs/src/syncop-utils.c @@ -10,6 +10,7 @@ #include "syncop.h" #include "common-utils.h" +#include "libglusterfs-messages.h" int syncop_dirfd (xlator_t *subvol, loc_t *loc, fd_t **fd, int pid) @@ -22,9 +23,9 @@ syncop_dirfd (xlator_t *subvol, loc_t *loc, fd_t **fd, int pid) dirfd = fd_create (loc->inode, pid); if (!dirfd) { - gf_log (subvol->name, GF_LOG_ERROR, - "fd_create of %s failed: %s", - uuid_utoa (loc->gfid), strerror(errno)); + gf_msg (subvol->name, GF_LOG_ERROR, errno, + LG_MSG_FD_CREATE_FAILED, "fd_create of %s", + uuid_utoa (loc->gfid)); ret = -errno; goto out; } @@ -44,18 +45,18 @@ syncop_dirfd (xlator_t *subvol, loc_t *loc, fd_t **fd, int pid) fd_unref (dirfd); dirfd = fd_anonymous (loc->inode); if (!dirfd) { - gf_log(subvol->name, GF_LOG_ERROR, - "fd_anonymous of %s failed: %s", - uuid_utoa (loc->gfid), strerror(errno)); + gf_msg (subvol->name, GF_LOG_ERROR, errno, + LG_MSG_FD_ANONYMOUS_FAILED, "fd_anonymous of " + "%s", uuid_utoa (loc->gfid)); ret = -errno; goto out; } ret = 0; #else /* GF_LINUX_HOST_OS */ fd_unref (dirfd); - gf_log (subvol->name, GF_LOG_ERROR, - "opendir of %s failed: %s", - uuid_utoa (loc->gfid), strerror(errno)); + gf_msg (subvol->name, GF_LOG_ERROR, errno, + LG_MSG_DIR_OP_FAILED, "opendir of %s", + uuid_utoa (loc->gfid)); goto out; #endif /* GF_LINUX_HOST_OS */ } @@ -299,7 +300,7 @@ syncop_is_subvol_local (xlator_t *this, loc_t *loc, gf_boolean_t *is_local) ret = glusterfs_is_local_pathinfo (pathinfo, is_local); - gf_log (this->name, GF_LOG_DEBUG, "subvol %s is %slocal", + gf_msg_debug (this->name, 0, "subvol %s is %slocal", this->name, is_local ? "" : "not "); out: -- cgit