[Ocfs2-tools-commits] smushran commits r719 - in trunk: mount.ocfs2 mounted.ocfs2 o2cb_ctl ocfs2cdsl tunefs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 21 13:12:10 CST 2005


Author: smushran
Signed-off-by: khackel
Date: 2005-03-21 13:12:08 -0600 (Mon, 21 Mar 2005)
New Revision: 719

Modified:
   trunk/mount.ocfs2/
   trunk/mount.ocfs2/mount.ocfs2.c
   trunk/mount.ocfs2/opts.c
   trunk/mount.ocfs2/opts.h
   trunk/mounted.ocfs2/
   trunk/o2cb_ctl/
   trunk/ocfs2cdsl/
   trunk/tunefs.ocfs2/
   trunk/tunefs.ocfs2/tunefs.c
Log:
mount.ocfs mounts from fstab
Signed-off-by:khackel


Property changes on: trunk/mount.ocfs2
___________________________________________________________________
Name: svn:ignore
   - .*.sw?
mount.ocfs2
*.d
cscope.*

   + .*.sw?
mount.ocfs2
*.d
cscope.*
ocfs2_hb_ctl


Modified: trunk/mount.ocfs2/mount.ocfs2.c
===================================================================
--- trunk/mount.ocfs2/mount.ocfs2.c	2005-03-21 10:17:20 UTC (rev 718)
+++ trunk/mount.ocfs2/mount.ocfs2.c	2005-03-21 19:12:08 UTC (rev 719)
@@ -181,13 +181,14 @@
 int main(int argc, char **argv)
 {
 	errcode_t ret = 0;
-	struct mount_options mo = { NULL, NULL, NULL };
+	struct mount_options mo;
 	char hbuuid[33];
 
 	initialize_ocfs_error_table();
 	initialize_o2dl_error_table();
 	initialize_o2cb_error_table();
 
+	memset(&mo, 0, sizeof(mo));
 	read_options (argc, argv, &mo);
 
 	ret = process_options(&mo);
@@ -209,14 +210,14 @@
 		goto bail;
 	}
 
-	ret = mount(mo.dev, mo.dir, "ocfs2", mo.flags, mo.xtra_opts);
+	ret = mount(mo.dev, mo.dir, "ocfs2", mo.flags & ~MS_NOSYS, mo.xtra_opts);
 	if (ret) {
 		fprintf(stderr, "error %d while mounting %s on %s", errno, 
 			mo.dev, mo.dir);
 		goto bail;
 	}
 
-	update_mtab_entry(mo.dev, mo.dir, "ocfs2", mo.xtra_opts, mo.flags, 0, 0);
+	update_mtab_entry(mo.dev, mo.dir, "ocfs2", mo.opts, mo.flags, 0, 0);
 
 bail:
 	free(mo.dev);

Modified: trunk/mount.ocfs2/opts.c
===================================================================
--- trunk/mount.ocfs2/opts.c	2005-03-21 10:17:20 UTC (rev 718)
+++ trunk/mount.ocfs2/opts.c	2005-03-21 19:12:08 UTC (rev 719)
@@ -36,29 +36,6 @@
   int  mask;			/* flag mask value */
 };
 
-/* Custom mount options for our own purposes.  */
-/* Maybe these should now be freed for kernel use again */
-#define MS_NOAUTO	0x80000000
-#define MS_USERS	0x40000000
-#define MS_USER		0x20000000
-#define MS_OWNER	0x10000000
-#define MS_GROUP	0x08000000
-#define MS_PAMCONSOLE   0x04000000
-#define MS_COMMENT	0x00020000
-#define MS_LOOP		0x00010000
-
-/* Options that we keep the mount system call from seeing.  */
-#define MS_NOSYS	(MS_NOAUTO|MS_USERS|MS_USER|MS_COMMENT|MS_LOOP|MS_PAMCONSOLE)
-
-/* Options that we keep from appearing in the options field in the mtab.  */
-#define MS_NOMTAB	(MS_REMOUNT|MS_NOAUTO|MS_USERS|MS_USER|MS_PAMCONSOLE)
-
-/* Options that we make ordinary users have by default.  */
-#define MS_SECURE	(MS_NOEXEC|MS_NOSUID|MS_NODEV)
-
-/* Options that we make owner-mounted devices have by default */
-#define MS_OWNERSECURE	(MS_NOSUID|MS_NODEV)
-
 static const struct opt_map opt_map[] = {
   { "defaults",	0, 0, 0		},	/* default options */
   { "ro",	1, 0, MS_RDONLY	},	/* read-only */

Modified: trunk/mount.ocfs2/opts.h
===================================================================
--- trunk/mount.ocfs2/opts.h	2005-03-21 10:17:20 UTC (rev 718)
+++ trunk/mount.ocfs2/opts.h	2005-03-21 19:12:08 UTC (rev 719)
@@ -20,4 +20,27 @@
  *
  */
 
+/* Custom mount options for our own purposes.  */
+/* Maybe these should now be freed for kernel use again */
+#define MS_NOAUTO	0x80000000
+#define MS_USERS	0x40000000
+#define MS_USER		0x20000000
+#define MS_OWNER	0x10000000
+#define MS_GROUP	0x08000000
+#define MS_PAMCONSOLE   0x04000000
+#define MS_COMMENT	0x00020000
+#define MS_LOOP		0x00010000
+
+/* Options that we keep the mount system call from seeing.  */
+#define MS_NOSYS	(MS_NOAUTO|MS_USERS|MS_USER|MS_COMMENT|MS_LOOP|MS_PAMCONSOLE)
+
+/* Options that we keep from appearing in the options field in the mtab.  */
+#define MS_NOMTAB	(MS_REMOUNT|MS_NOAUTO|MS_USERS|MS_USER|MS_PAMCONSOLE)
+
+/* Options that we make ordinary users have by default.  */
+#define MS_SECURE	(MS_NOEXEC|MS_NOSUID|MS_NODEV)
+
+/* Options that we make owner-mounted devices have by default */
+#define MS_OWNERSECURE	(MS_NOSUID|MS_NODEV)
+
 void parse_opts (char *options, int *flags, char **extra_opts);


Property changes on: trunk/mounted.ocfs2
___________________________________________________________________
Name: svn:ignore
   - mounted.ocfs2
stamp-md5
.*.sw?
cscope.*
*.d

   + mounted.ocfs2
stamp-md5
.*.sw?
cscope.*
*.d
mounted.ocfs2.8



Property changes on: trunk/o2cb_ctl
___________________________________________________________________
Name: svn:ignore
   - .*.sw?
*.d
clusterbo
o2cb_ctl

   + .*.sw?
*.d
clusterbo
o2cb_ctl
o2cb_ctl.8



Property changes on: trunk/ocfs2cdsl
___________________________________________________________________
Name: svn:ignore
   - .*.sw?
ocfs2cdsl
stamp-md5
*.d

   + .*.sw?
ocfs2cdsl
stamp-md5
*.d
ocfs2cdsl.8



Property changes on: trunk/tunefs.ocfs2
___________________________________________________________________
Name: svn:ignore
   - cscope*
tunefs.ocfs2
.*.sw?
stamp-md5
*.d

   + cscope*
tunefs.ocfs2
.*.sw?
stamp-md5
*.d
tunefs.ocfs2.8


Modified: trunk/tunefs.ocfs2/tunefs.c
===================================================================
--- trunk/tunefs.ocfs2/tunefs.c	2005-03-21 10:17:20 UTC (rev 718)
+++ trunk/tunefs.ocfs2/tunefs.c	2005-03-21 19:12:08 UTC (rev 719)
@@ -220,6 +220,7 @@
 		{ "version", 0, 0, 'V' },
 		{ "journal-options", 0, 0, 'J'},
 		{ "volume-size", 0, 0, 'S'},
+		{ "noprompt", 0, 0, 'x' },
 		{ 0, 0, 0, 0}
 	};
 
@@ -231,7 +232,7 @@
 	opts.prompt = 1;
 
 	while (1) {
-		c = getopt_long(argc, argv, "L:N:J:S:vqV", long_options, 
+		c = getopt_long(argc, argv, "L:N:J:S:vqVx", long_options, 
 				NULL);
 
 		if (c == -1)



More information about the Ocfs2-tools-commits mailing list