Re: [Patch 7/10] NFS Mount Configuration File (Vers 3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How come the short descriptions (Subject:) for all of these patches are identical?

On Aug 6, 2009, at 2:46 PM, Steve Dickson wrote:
commit eab66bd02db90965d1cbf4e100a274a4e3e6e29e
Author: Steve Dickson <steved@xxxxxxxxxx>
Date:   Sun Aug 2 12:37:19 2009 -0400

   Added hooks to the mount command that allow
   mount options to be set in a configuration file

   Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>

diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index a668cd9..30d087e 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -47,6 +47,11 @@
#include "stropts.h"
#include "version.h"

+#ifdef MOUNT_CONFIG
+#include "conffile.h"
+extern char *conf_get_mntopts(char *, char *, char *);

Can this forward declaration be added to conffile.h ?

+#endif
+
char *progname;
int nfs_mount_data_version;
int nomtab;
@@ -474,6 +479,13 @@ int main(int argc, char *argv[])
	spec = argv[1];
	mount_point = argv[2];

+#ifdef MOUNT_CONFIG
+	/*
+	 * Read the the default mount options
+	 */
+	conf_init();
+#endif

It would be cleaner if the #ifdefs were moved to conf_init() (and above, for the #include, and below, into conf_get_mntopts()). If MOUNT_CONFIG isn't set, then configfile.o would just contain stubs, but it would then always be built.

Otherwise, we end up with each new feature adding #ifdefs in the mainline code, and eventually it becomes unreadable.

+
	argv[2] = argv[0]; /* so that getopt error messages are correct */
	while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hs",
				longopts, NULL)) != -1) {
@@ -559,6 +571,12 @@ int main(int argc, char *argv[])
		mnt_err = EX_USAGE;
		goto out;
	}
+#ifdef MOUNT_CONFIG
+	/*
+	 * Concatenate mount options from the configuration file
+	 */
+	mount_opts = conf_get_mntopts(spec, mount_point, mount_opts);
+#endif

	parse_opts(mount_opts, &flags, &extra_opts);

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux