From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH v5 02/20] ext4: add handling for extended mount options
Date: Mon, 9 Mar 2020 00:05:08 -0700 [thread overview]
Message-ID: <20200309070526.218202-2-harshadshirwadkar@gmail.com> (raw)
In-Reply-To: <20200309070526.218202-1-harshadshirwadkar@gmail.com>
We are running out of mount option bits. Add handling for using
s_mount_opt2. Add ability to turn on / off the fast commit
feature and to turn on / off fast commit soft consistency option.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
fs/ext4/ext4.h | 7 +++++++
fs/ext4/super.c | 23 +++++++++++++++++++----
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 61b37a052052..f96a672232a1 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1173,6 +1173,13 @@ struct ext4_inode_info {
#define EXT4_MOUNT2_EXPLICIT_JOURNAL_CHECKSUM 0x00000008 /* User explicitly
specified journal checksum */
+#define EXT4_MOUNT2_JOURNAL_FAST_COMMIT 0x00000010 /* Journal fast commit */
+
+#define EXT4_MOUNT2_JOURNAL_FC_SOFT_CONSISTENCY 0x00000020 /* Soft consistency
+ * mode for fast
+ * commits
+ */
+
#define clear_opt(sb, opt) EXT4_SB(sb)->s_mount_opt &= \
~EXT4_MOUNT_##opt
#define set_opt(sb, opt) EXT4_SB(sb)->s_mount_opt |= \
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ff1b764b0c0e..00571de3390b 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1526,6 +1526,7 @@ enum {
Opt_dioread_nolock, Opt_dioread_lock,
Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
Opt_max_dir_size_kb, Opt_nojournal_checksum, Opt_nombcache,
+ Opt_no_fc, Opt_fc_soft_consistency
};
static const match_table_t tokens = {
@@ -1609,6 +1610,8 @@ static const match_table_t tokens = {
{Opt_init_itable, "init_itable=%u"},
{Opt_init_itable, "init_itable"},
{Opt_noinit_itable, "noinit_itable"},
+ {Opt_no_fc, "no_fc"},
+ {Opt_fc_soft_consistency, "fc_soft_consistency"},
{Opt_max_dir_size_kb, "max_dir_size_kb=%u"},
{Opt_test_dummy_encryption, "test_dummy_encryption"},
{Opt_nombcache, "nombcache"},
@@ -1731,6 +1734,7 @@ static int clear_qf_name(struct super_block *sb, int qtype)
#define MOPT_NO_EXT3 0x0200
#define MOPT_EXT4_ONLY (MOPT_NO_EXT2 | MOPT_NO_EXT3)
#define MOPT_STRING 0x0400
+#define MOPT_2 0x0800
static const struct mount_opts {
int token;
@@ -1823,6 +1827,10 @@ static const struct mount_opts {
{Opt_max_dir_size_kb, 0, MOPT_GTE0},
{Opt_test_dummy_encryption, 0, MOPT_GTE0},
{Opt_nombcache, EXT4_MOUNT_NO_MBCACHE, MOPT_SET},
+ {Opt_no_fc, EXT4_MOUNT2_JOURNAL_FAST_COMMIT,
+ MOPT_CLEAR | MOPT_2 | MOPT_EXT4_ONLY},
+ {Opt_fc_soft_consistency, EXT4_MOUNT2_JOURNAL_FC_SOFT_CONSISTENCY,
+ MOPT_SET | MOPT_2 | MOPT_EXT4_ONLY},
{Opt_err, 0, 0}
};
@@ -2113,10 +2121,17 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
WARN_ON(1);
return -1;
}
- if (arg != 0)
- sbi->s_mount_opt |= m->mount_opt;
- else
- sbi->s_mount_opt &= ~m->mount_opt;
+ if (m->flags & MOPT_2) {
+ if (arg != 0)
+ sbi->s_mount_opt2 |= m->mount_opt;
+ else
+ sbi->s_mount_opt2 &= ~m->mount_opt;
+ } else {
+ if (arg != 0)
+ sbi->s_mount_opt |= m->mount_opt;
+ else
+ sbi->s_mount_opt &= ~m->mount_opt;
+ }
}
return 1;
}
--
2.25.1.481.gfbce0eb801-goog
next prev parent reply other threads:[~2020-03-09 7:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tytso@mit.edu>
2020-03-09 7:05 ` [PATCH v5 01/20] ext4: update docs for fast commit feature Harshad Shirwadkar
2020-03-09 7:05 ` Harshad Shirwadkar [this message]
2020-03-09 7:05 ` [PATCH v5 03/20] ext4, jbd2: add fast commit initialization routines Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 04/20] jbd2: add fast commit block tracker variables Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 05/20] jbd2: disable fast commits if journal is empty Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 06/20] jbd2: fast commit main commit path changes Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 07/20] ext4: add generic diff tracking routines and range tracking Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 08/20] ext4: add directory entry tracking routines Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 09/20] ext4: add inode tracking and ineligible marking routines Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 10/20] ext4: break ext4_unlink() and ext4_link() Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 11/20] ext4: add fast commit track points Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 12/20] ext4: add fast commit on-disk format structs Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 13/20] jbd2: add new APIs for commit path of fast commits Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 14/20] ext4: main commit routine for " Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 15/20] jbd2: add fast commit recovery path support Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 16/20] ext4: fast commit recovery path preparation Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 17/20] ext4: add idempotent helpers to manipulate bitmaps Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 18/20] ext4: disable certain features in replay path Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 19/20] ext4: add fast commit " Harshad Shirwadkar
2020-03-09 7:05 ` [PATCH v5 20/20] ext4: add debug mount option to test fast commit replay Harshad Shirwadkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200309070526.218202-2-harshadshirwadkar@gmail.com \
--to=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).