From: Chuck Lever Date: Mon, 24 Sep 2007 15:29:05 +0000 (-0400) Subject: mount.nfs: rename mount_errors() X-Git-Tag: nfs-utils-1-1-1~47 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=4398901d336340f5bef59991d4cea77b2970f2fe;hp=46572b00147b2ed5722ba4167073e7c2eb42ad74 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. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- 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) {