linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@google.com>
Subject: [PATCH] mkfs.f2fs: support fsverity feature
Date: Wed, 28 Mar 2018 21:18:31 -0700	[thread overview]
Message-ID: <20180329041831.98141-1-jaegeuk@kernel.org> (raw)

From: Jaegeuk Kim <jaegeuk@google.com>

This is aligned to f2fs which reserves fsverity feature bit.

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
---
 fsck/mount.c            |  3 +++
 include/f2fs_fs.h       | 12 ++++++++----
 mkfs/f2fs_format_main.c |  2 ++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/fsck/mount.c b/fsck/mount.c
index a925bb9..e5574c5 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -439,6 +439,9 @@ void print_sb_state(struct f2fs_super_block *sb)
 	if (f & cpu_to_le32(F2FS_FEATURE_ENCRYPT)) {
 		MSG(0, "%s", " encrypt");
 	}
+	if (f & cpu_to_le32(F2FS_FEATURE_VERITY)) {
+		MSG(0, "%s", " verity");
+	}
 	if (f & cpu_to_le32(F2FS_FEATURE_BLKZONED)) {
 		MSG(0, "%s", " blkzoned");
 	}
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index c460050..4dd2106 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -563,6 +563,7 @@ enum {
 #define F2FS_FEATURE_QUOTA_INO		0x0080
 #define F2FS_FEATURE_INODE_CRTIME	0x0100
 #define F2FS_FEATURE_LOST_FOUND		0x0200
+#define F2FS_FEATURE_VERITY		0x0400	/* reserved */
 
 #define MAX_VOLUME_NAME		512
 
@@ -745,10 +746,13 @@ struct f2fs_extent {
 /*
  * i_advise uses FADVISE_XXX_BIT. We can add additional hints later.
  */
-#define FADVISE_COLD_BIT       0x01
-#define FADVISE_LOST_PINO_BIT  0x02
-#define FADVISE_ENCRYPT_BIT    0x04
-#define FADVISE_ENC_NAME_BIT   0x08
+#define FADVISE_COLD_BIT	0x01
+#define FADVISE_LOST_PINO_BIT	0x02
+#define FADVISE_ENCRYPT_BIT	0x04
+#define FADVISE_ENC_NAME_BIT	0x08
+#define FADVISE_KEEP_SIZE_BIT	0x10
+#define FADVISE_HOT_BIT		0x20
+#define FADVISE_VERITY_BIT	0x40	/* reserved */
 
 #define file_is_encrypt(fi)      ((fi)->i_advise & FADVISE_ENCRYPT_BIT)
 #define file_enc_name(fi)        ((fi)->i_advise & FADVISE_ENC_NAME_BIT)
diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index 71fd7c2..741600e 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -86,6 +86,8 @@ static void parse_feature(const char *features)
 		features++;
 	if (!strcmp(features, "encrypt")) {
 		c.feature |= cpu_to_le32(F2FS_FEATURE_ENCRYPT);
+	} else if (!strcmp(features, "verity")) {
+		c.feature |= cpu_to_le32(F2FS_FEATURE_VERITY);
 	} else if (!strcmp(features, "extra_attr")) {
 		c.feature |= cpu_to_le32(F2FS_FEATURE_EXTRA_ATTR);
 	} else if (!strcmp(features, "project_quota")) {
-- 
2.15.0.531.g2ccb3012c9-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

                 reply	other threads:[~2018-03-29  4:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180329041831.98141-1-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=jaegeuk@google.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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).