]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mount.nfs: rename mount_errors()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 24 Sep 2007 15:29:05 +0000 (11:29 -0400)
committerNeil Brown <neilb@suse.de>
Tue, 25 Sep 2007 01:50:16 +0000 (11:50 +1000)
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 <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
utils/mount/error.c
utils/mount/error.h
utils/mount/nfs4mount.c
utils/mount/nfsmount.c

index 1f60b79f2ebadb6a86ea29684240fcff7c57df93..3f7458c96ed0574ff3237ba0ac77a077642b3606 100644 (file)
@@ -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;
index 5e4b01b188d4e30f7b86c3ef4b644f7b83399c5b..ce9a7b651884f297a11da7e33015c5000ca75a47 100644 (file)
@@ -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 *);
index 4790c7998b11ff548fd4ef9d4dcbad639d7c664c..0a32c3c4f644444e135ebb2405b6130077960fc3 100644 (file)
@@ -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;
        }
 
index 6c34a2b3aaf91ebd49a3a23c9e3f5e2e0d1b74d6..23dd2f607eafcbb739bc6d0e461dd28cb0666f79 100644 (file)
@@ -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) {