+extern int sloppy;
+
+union nfs_sockaddr {
+ struct sockaddr sa;
+ struct sockaddr_in s4;
+ struct sockaddr_in6 s6;
+};
+
+struct nfsmount_info {
+ const char *spec, /* server:/path */
+ *node, /* mounted-on dir */
+ *type; /* "nfs" or "nfs4" */
+ char *hostname; /* server's hostname */
+ union nfs_sockaddr address;
+ socklen_t salen; /* size of server's address */
+
+ struct mount_options *options; /* parsed mount options */
+ char **extra_opts; /* string for /etc/mtab */
+
+ unsigned long version; /* NFS version */
+ int flags, /* MS_ flags */
+ fake, /* actually do the mount? */
+ child; /* forked bg child? */
+};
+
+#ifdef MOUNT_CONFIG
+static void nfs_default_version(struct nfsmount_info *mi);
+
+static void nfs_default_version(struct nfsmount_info *mi)
+{
+ extern unsigned long config_default_vers;
+ /*
+ * Use the default value set in the config file when
+ * the version has not been explicitly set.
+ */
+ if (mi->version == 0 && config_default_vers) {
+ if (config_default_vers < 4)
+ mi->version = config_default_vers;
+ }
+}
+#else
+inline void nfs_default_version(struct nfsmount_info *mi) {}
+#endif /* MOUNT_CONFIG */
+
+/*
+ * Obtain a retry timeout value based on the value of the "retry=" option.
+ *
+ * Returns a time_t timeout timestamp, in seconds.
+ */
+static time_t nfs_parse_retry_option(struct mount_options *options,
+ unsigned int timeout_minutes)
+{
+ long tmp;
+
+ switch (po_get_numeric(options, "retry", &tmp)) {
+ case PO_NOT_FOUND:
+ break;
+ case PO_FOUND:
+ if (tmp >= 0) {
+ timeout_minutes = tmp;
+ break;
+ }
+ case PO_BAD_VALUE:
+ if (verbose)
+ nfs_error(_("%s: invalid retry timeout was specified; "
+ "using default timeout"), progname);
+ break;
+ }