diff options
author | Manikandan Selvaganesh <mselvaga@redhat.com> | 2015-04-13 12:21:09 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-04-28 11:50:41 -0700 |
commit | ee6cd10ce947787bf6ea589bca1cb259c4bb214d (patch) | |
tree | 8ffdb8a6c78bb8d16a2311c39c2b386558d08e26 /xlators/nfs/server/src/mount3udp_svc.c | |
parent | 428933dce2c87ea62b4f58af7d260064fade6a8b (diff) |
nfs / mount files : porting log messages to a new framework
Porting log messages to a new framework for mount3udp_svc.c,
mount3.c, mount3-auth.c files.
Change-Id: I1e9cab500b6052bfac43c5ae1c82278e20d2f898
BUG: 1194640
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/10210
Tested-by: NetBSD Build System
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/mount3udp_svc.c')
-rw-r--r-- | xlators/nfs/server/src/mount3udp_svc.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/xlators/nfs/server/src/mount3udp_svc.c b/xlators/nfs/server/src/mount3udp_svc.c index 4ad8e11ad49..e8e226e953e 100644 --- a/xlators/nfs/server/src/mount3udp_svc.c +++ b/xlators/nfs/server/src/mount3udp_svc.c @@ -13,6 +13,7 @@ #include "logging.h" #include "mem-pool.h" #include "nfs-mem-types.h" +#include "nfs-messages.h" #include "mount3.h" #include <stdio.h> #include <stdlib.h> @@ -63,12 +64,14 @@ mountudpproc3_mnt_3_svc(dirpath **dpp, struct svc_req *req) res = GF_CALLOC (1, sizeof(*res), gf_nfs_mt_mountres3); if (res == NULL) { - gf_log (GF_MNT, GF_LOG_ERROR, "Unable to allocate memory"); + gf_msg (GF_MNT, GF_LOG_ERROR, ENOMEM, NFS_MSG_NO_MEMORY, + "Unable to allocate memory"); goto err; } autharr = GF_CALLOC (MNT3UDP_AUTH_LEN, sizeof(int), gf_nfs_mt_int); if (autharr == NULL) { - gf_log (GF_MNT, GF_LOG_ERROR, "Unable to allocate memory"); + gf_msg (GF_MNT, GF_LOG_ERROR, ENOMEM, NFS_MSG_NO_MEMORY, + "Unable to allocate memory"); goto err; } @@ -78,7 +81,8 @@ mountudpproc3_mnt_3_svc(dirpath **dpp, struct svc_req *req) /* FAILURE: No FH */ if (fh == NULL) { - gf_log (GF_MNT, GF_LOG_ERROR, "Unable to get fh for %s", mpath); + gf_msg (GF_MNT, GF_LOG_ERROR, errno, NFS_MSG_GET_FH_FAIL, + "Unable to get fh for %s", mpath); if (errno) stat = mnt3svc_errno_to_mnterr (errno); *res = mnt3svc_set_mountres3 (stat, NULL /* fh */, @@ -108,7 +112,8 @@ mountudpproc3_umnt_3_svc(dirpath **dp, struct svc_req *req) stat = GF_CALLOC (1, sizeof(mountstat3), gf_nfs_mt_mountstat3); if (stat == NULL) { - gf_log (GF_MNT, GF_LOG_ERROR, "Unable to allocate memory"); + gf_msg (GF_MNT, GF_LOG_ERROR, ENOMEM, NFS_MSG_NO_MEMORY, + "Unable to allocate memory"); return NULL; } *stat = MNT3_OK; @@ -163,17 +168,19 @@ mountudp_program_3(struct svc_req *rqstp, register SVCXPRT *transp) } result = (*local)((char *)&argument, rqstp); if (result == NULL) { - gf_log (GF_MNT, GF_LOG_DEBUG, "PROC returned error"); + gf_msg_debug (GF_MNT, 0, "PROC returned error"); svcerr_systemerr (transp); } if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) { - gf_log (GF_MNT, GF_LOG_ERROR, "svc_sendreply returned error"); + gf_msg (GF_MNT, GF_LOG_ERROR, 0, NFS_MSG_SVC_ERROR, + "svc_sendreply returned error"); svcerr_systemerr (transp); } if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) { - gf_log (GF_MNT, GF_LOG_ERROR, "Unable to free arguments"); + gf_msg (GF_MNT, GF_LOG_ERROR, 0, NFS_MSG_ARG_FREE_FAIL, + "Unable to free arguments"); } if (result == NULL) return; @@ -202,23 +209,26 @@ mount3udp_thread (void *argv) GF_ASSERT (nfsx); if (glusterfs_this_set(nfsx)) { - gf_log (GF_MNT, GF_LOG_ERROR, + gf_msg (GF_MNT, GF_LOG_ERROR, ENOMEM, NFS_MSG_XLATOR_SET_FAIL, "Failed to set xlator, nfs.mount-udp will not work"); return NULL; } transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) { - gf_log (GF_MNT, GF_LOG_ERROR, "svcudp_create error"); + gf_msg (GF_MNT, GF_LOG_ERROR, 0, NFS_MSG_SVC_ERROR, + "svcudp_create error"); return NULL; } if (!svc_register(transp, MOUNT_PROGRAM, MOUNT_V3, mountudp_program_3, IPPROTO_UDP)) { - gf_log (GF_MNT, GF_LOG_ERROR, "svc_register error"); + gf_msg (GF_MNT, GF_LOG_ERROR, 0, NFS_MSG_SVC_ERROR, + "svc_register error"); return NULL; } svc_run (); - gf_log (GF_MNT, GF_LOG_ERROR, "svc_run returned"); + gf_msg (GF_MNT, GF_LOG_ERROR, 0, NFS_MSG_SVC_RUN_RETURNED, + "svc_run returned"); return NULL; } |