From de7c629d02b723e6b4c3d50a14ea5f072e27ccc1 Mon Sep 17 00:00:00 2001 From: Manikandan Selvaganesh Date: Tue, 7 Apr 2015 12:49:37 +0530 Subject: nfs/auth,exports,netgroup : port log messages to new framework Five gf_log messages are not changed to gf_msg because gf_msg not sending the output to STDOUT. Bug id : BZ1215017 Change-Id: Ie8de286355becc3fd73fa80057734b834cf40b04 BUG: 1194640 Signed-off-by: Manikandan Selvaganesh Reviewed-on: http://review.gluster.org/10173 Tested-by: Gluster Build System Reviewed-by: Niels de Vos Tested-by: NetBSD Build System Reviewed-by: jiffin tony Thottan --- xlators/nfs/server/src/auth-cache.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'xlators/nfs/server/src/auth-cache.c') diff --git a/xlators/nfs/server/src/auth-cache.c b/xlators/nfs/server/src/auth-cache.c index 01ebaed04d2..b33dc96db6f 100644 --- a/xlators/nfs/server/src/auth-cache.c +++ b/xlators/nfs/server/src/auth-cache.c @@ -14,6 +14,7 @@ #include "auth-cache.h" #include "nfs3.h" #include "exports.h" +#include "nfs-messages.h" enum auth_cache_lookup_results { ENTRY_FOUND = 0, @@ -80,7 +81,8 @@ auth_cache_entry_init () entry = GF_CALLOC (1, sizeof (*entry), gf_nfs_mt_auth_cache_entry); if (!entry) - gf_log (GF_NFS, GF_LOG_WARNING, "failed to allocate entry"); + gf_msg (GF_NFS, GF_LOG_WARNING, ENOMEM, NFS_MSG_NO_MEMORY, + "failed to allocate entry"); return entry; } @@ -122,16 +124,16 @@ auth_cache_lookup (struct auth_cache *cache, struct nfs3_fh *fh, entry_data = dict_get (cache->cache_dict, hashkey); if (!entry_data) { - gf_log (GF_NFS, GF_LOG_DEBUG, "could not find entry for %s", - host_addr); + gf_msg_debug (GF_NFS, 0, "could not find entry for %s", + host_addr); goto out; } lookup_res = (struct auth_cache_entry *)(entry_data->data); if ((time (NULL) - lookup_res->timestamp) > cache->ttl_sec) { - gf_log (GF_NFS, GF_LOG_DEBUG, "entry for host %s has expired", - host_addr); + gf_msg_debug (GF_NFS, 0, "entry for host %s has expired", + host_addr); GF_FREE (lookup_res); entry_data->data = NULL; /* Remove from the cache */ @@ -274,8 +276,8 @@ cache_nfs_fh (struct auth_cache *cache, struct nfs3_fh *fh, /* If we could already find it in the cache, just return */ ret = auth_cache_lookup (cache, fh, host_addr, ×tamp, &can_write); if (ret == 0) { - gf_log (GF_NFS, GF_LOG_TRACE, "found cached auth/fh for host " - "%s", host_addr); + gf_msg_trace (GF_NFS, 0, "found cached auth/fh for host " + "%s", host_addr); goto out; } @@ -304,7 +306,7 @@ cache_nfs_fh (struct auth_cache *cache, struct nfs3_fh *fh, GF_FREE (entry); goto out; } - gf_log (GF_NFS, GF_LOG_TRACE, "Caching file-handle (%s)", host_addr); + gf_msg_trace (GF_NFS, 0, "Caching file-handle (%s)", host_addr); ret = 0; out: return ret; -- cgit