From: Chuck Lever Subject: [PATCH 06/19] mount.nfs: rename mount_errors() Date: Mon, 10 Sep 2007 20:58:55 -0400 Message-ID: <20070911005855.24927.4405.stgit@monet.1015granger.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: nfs@lists.sourceforge.net Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1IUu5c-0002wZ-Al for nfs@lists.sourceforge.net; Mon, 10 Sep 2007 17:58:52 -0700 Received: from flpi102.sbcis.sbc.com ([207.115.20.71] helo=flpi102.prodigy.net) by mail.sourceforge.net with esmtp (Exim 4.44) id 1IUu5g-0001Ab-Pg for nfs@lists.sourceforge.net; Mon, 10 Sep 2007 17:58:57 -0700 Received: from monet.1015granger.net (adsl-76-241-169-38.dsl.sfldmi.sbcglobal.net [76.241.169.38]) by flpi102.prodigy.net (8.13.8 out.dk.spool/8.13.8) with ESMTP id l8B0wjJ5027888 for ; Mon, 10 Sep 2007 17:58:45 -0700 Received: from monet.1015granger.net (monet.1015granger.net [127.0.0.1]) by monet.1015granger.net (8.14.1/8.14.1) with ESMTP id l8B0wtFn025020 for ; Mon, 10 Sep 2007 20:58:55 -0400 List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net The function mount_errors() actually reports RPC errors generated by the user-land RPC library. We're about to add a similar function for reporting system call errors via errno, so rename mount_errors() to be more specific about what it does. Signed-off-by: Chuck Lever --- utils/mount/error.c | 11 ++++++++++- utils/mount/error.h | 2 +- utils/mount/nfs4mount.c | 6 +++--- utils/mount/nfsmount.c | 10 +++++----- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/utils/mount/error.c b/utils/mount/error.c index 1f60b79..3f7458c 100644 --- a/utils/mount/error.c +++ b/utils/mount/error.c @@ -76,7 +76,16 @@ static int rpc_strerror(int spos) return pos; } -void mount_errors(char *server, int will_retry, int bg) +/** + * rpc_mount_errors - log an RPC error that occurred during a user-space mount + * @server: C string containing name of server we are attempting to mount + * @will_retry: one indicates mount will retry at some later point + * @bg: one indicates this is a background mount + * + * Extracts the error code from the user-space RPC library, and reports it + * on stderr (fg mount) or in the system log (bg mount). + */ +void rpc_mount_errors(char *server, int will_retry, int bg) { int pos = 0; char *tmp; diff --git a/utils/mount/error.h b/utils/mount/error.h index 5e4b01b..ce9a7b6 100644 --- a/utils/mount/error.h +++ b/utils/mount/error.h @@ -24,5 +24,5 @@ char *nfs_strerror(int); void mount_error(const char *, const char *, int); -void mount_errors(char *, int, int); +void rpc_mount_errors(char *, int, int); void umount_error(int, const char *); diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c index c4e8bfb..a4d9ae5 100644 --- a/utils/mount/nfs4mount.c +++ b/utils/mount/nfs4mount.c @@ -428,15 +428,15 @@ int nfs4mount(const char *spec, const char *node, int flags, if (errno == ETIMEDOUT) break; default: - mount_errors(hostname, 0, bg); + rpc_mount_errors(hostname, 0, bg); goto fail; } t = time(NULL); if (t >= timeout) { - mount_errors(hostname, 0, bg); + rpc_mount_errors(hostname, 0, bg); goto fail; } - mount_errors(hostname, 1, bg); + rpc_mount_errors(hostname, 1, bg); continue; } diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c index 5839482..ce4cf9a 100644 --- a/utils/mount/nfsmount.c +++ b/utils/mount/nfsmount.c @@ -688,15 +688,15 @@ nfsmount(const char *spec, const char *node, int flags, if (errno == ETIMEDOUT) break; default: - mount_errors(*nfs_server.hostname, 0, bg); + rpc_mount_errors(*nfs_server.hostname, 0, bg); goto fail; } t = time(NULL); if (t >= timeout) { - mount_errors(*nfs_server.hostname, 0, bg); + rpc_mount_errors(*nfs_server.hostname, 0, bg); goto fail; } - mount_errors(*nfs_server.hostname, 1, bg); + rpc_mount_errors(*nfs_server.hostname, 1, bg); continue; } if (!running_bg) { @@ -707,11 +707,11 @@ nfsmount(const char *spec, const char *node, int flags, } t = time(NULL); if (t >= timeout) { - mount_errors(*nfs_server.hostname, 0, bg); + rpc_mount_errors(*nfs_server.hostname, 0, bg); goto fail; } if (doonce++ < 1) - mount_errors(*nfs_server.hostname, 1, bg); + rpc_mount_errors(*nfs_server.hostname, 1, bg); } if (nfs_pmap->pm_vers == 2) { ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs