NFS: Improve debugging output in NFS in-kernel mount client
Subsystems (2)
PATCH 6/13 NFS: Improve debugging output in NFS in-kernel mount client
Signed-off-by Chuck Lever <[email protected]>
---
fs/nfs/mount_clnt.c | 18 +++++++++++++----- include/linux/nfs_fs.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-)
fs/nfs/mount_clnt.c +13 -5
@@ -16,7 +16,7 @@#include <linux/nfs_fs.h> #ifdef RPC_DEBUG -# define NFSDBG_FACILITY NFSDBG_ROOT +# define NFSDBG_FACILITY NFSDBG_MOUNT#endif static struct rpc_program mnt_program;
@@ -72,8 +72,8 @@ int nfs_mount(struct sockaddr_in *addr, char *path, struct nfs_fh *fh,char hostname[32 ];int status; -dprintk ("NFS: nfs_mount(%08x:%s)\n" , - (unsigned )ntohl (addr->sin_addr.s_addr), path); +dprintk ("NFS: %s: mounting" NIPQUAD_FMT ":%s\n" , + __FUNCTION__,NIPQUAD (addr->sin_addr.s_addr), path);sprintf (hostname,NIPQUAD_FMT ,NIPQUAD (addr->sin_addr.s_addr)); mnt_clnt =mnt_create (hostname, addr, version, protocol);
@@ -86,10 +86,18 @@ int nfs_mount(struct sockaddr_in *addr, char *path, struct nfs_fh *fh, msg.rpc_proc = &mnt_clnt->cl_procinfo[MNTPROC_MNT ]; status =rpc_call_sync (mnt_clnt, &msg,0 ); -if (status <0 ) +if (status <0 ) { +dprintk ("NFS: %s: rpc_call_sync returned %d\n" , + __FUNCTION__, status);return status; -if (result.status !=0 ) + } +if (result.status !=0 ) { +dprintk ("NFS: %s: server returned %d\n" , + __FUNCTION__, result.status);return -EACCES ; + } +dprintk ("NFS: %s: mount request succeeded\n" , + __FUNCTION__);return 0 ; }
include/linux/nfs_fs.h +1 -0
@@ -555,6 +555,7 @@ extern void * nfs_root_data(void);#define NFSDBG_ROOT 0x0080#define NFSDBG_CALLBACK 0x0100#define NFSDBG_CLIENT 0x0200 +#define NFSDBG_MOUNT 0x0400#define NFSDBG_ALL 0xFFFF#ifdef __KERNEL__