diff options
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; } |