linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 2/2] add a mount option for ext3 to support the unclean jbd option
@ 2008-03-04 18:41 Josef Bacik
  0 siblings, 0 replies; only message in thread
From: Josef Bacik @ 2008-03-04 18:41 UTC (permalink / raw)
  To: linux-ext4; +Cc: Jan Kara

Hello,

I'm just now realizing i sent the previous patch with 1/1 instead of 1/2 in the 
subject :(.  This just lets me use "unclean_journal" as a mount option to flip 
the appropriate flag for the journal in order to make it not reset the journal 
when we unmount the fs.  Thanks much,

Josef

Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c
+++ linux-2.6/fs/ext3/super.c
@@ -625,6 +625,9 @@ static int ext3_show_options(struct seq_
 	else if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA)
 		seq_puts(seq, ",data=writeback");
 
+	if (test_opt(sb, UNCLEAN_JOURNAL))
+		seq_puts(seq, ",unclean_journal");
+
 	ext3_show_quota_options(seq, sb);
 
 	return 0;
@@ -756,7 +759,7 @@ enum {
 	Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
 	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
 	Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
-	Opt_grpquota
+	Opt_grpquota, Opt_unclean_journal,
 };
 
 static match_table_t tokens = {
@@ -807,6 +810,7 @@ static match_table_t tokens = {
 	{Opt_usrquota, "usrquota"},
 	{Opt_barrier, "barrier=%u"},
 	{Opt_resize, "resize"},
+	{Opt_unclean_journal, "unclean_journal"},
 	{Opt_err, NULL},
 };
 
@@ -1138,6 +1142,9 @@ clear_qf_name:
 		case Opt_bh:
 			clear_opt(sbi->s_mount_opt, NOBH);
 			break;
+		case Opt_unclean_journal:
+			set_opt(sbi->s_mount_opt, UNCLEAN_JOURNAL);
+			break;
 		default:
 			printk (KERN_ERR
 				"EXT3-fs: Unrecognized mount option \"%s\" "
@@ -1968,6 +1975,12 @@ static void ext3_init_journal_params(str
 		journal->j_flags |= JFS_BARRIER;
 	else
 		journal->j_flags &= ~JFS_BARRIER;
+
+	if (test_opt(sb, UNCLEAN_JOURNAL))
+		journal->j_flags |= JFS_UNCLEAN;
+	else
+		journal->j_flags &= ~JFS_UNCLEAN;
+
 	spin_unlock(&journal->j_state_lock);
 }
 
Index: linux-2.6/include/linux/ext3_fs.h
===================================================================
--- linux-2.6.orig/include/linux/ext3_fs.h
+++ linux-2.6/include/linux/ext3_fs.h
@@ -380,6 +380,7 @@ struct ext3_inode {
 #define EXT3_MOUNT_QUOTA		0x80000 /* Some quota option set */
 #define EXT3_MOUNT_USRQUOTA		0x100000 /* "old" user quota */
 #define EXT3_MOUNT_GRPQUOTA		0x200000 /* "old" group quota */
+#define EXT3_MOUNT_UNCLEAN_JOURNAL	0x400000 /* Leave an unclean journal */
 
 /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
 #ifndef _LINUX_EXT2_FS_H

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-04 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-04 18:41 [RFC PATCH 2/2] add a mount option for ext3 to support the unclean jbd option Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).