Skip to contentSkip to conversation

mount.nfs: rename mount_errors()

PATCH New Chuck Lever 1 participant 1 message Sep 11, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/19 mount.nfs: rename mount_errors()

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.

---

 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(-)
utils/mount/error.c +10 -1
index 1f60b79..3f7458c 100644
@@ -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;
utils/mount/error.h +1 -1
index 5e4b01b..ce9a7b6 100644
@@ -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 *);
utils/mount/nfs4mount.c +3 -3
index c4e8bfb..a4d9ae5 100644
@@ -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;
 	}
 
utils/mount/nfsmount.c +5 -5
index 5839482..ce4cf9a 100644
@@ -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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs