summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utils/mount/error.c11
-rw-r--r--utils/mount/error.h2
-rw-r--r--utils/mount/nfs4mount.c6
-rw-r--r--utils/mount/nfsmount.c10
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 4790c79..0a32c3c 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 6c34a2b..23dd2f6 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) {