All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 04/19] f2fs: add feature facility in superblock
Date: Fri,  1 May 2015 17:48:31 -0700	[thread overview]
Message-ID: <1430527726-68547-4-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1430527726-68547-1-git-send-email-jaegeuk@kernel.org>

This patch introduces a feature in superblock, which will indicate any new
features for f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/f2fs.h          | 7 +++++++
 include/linux/f2fs_fs.h | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cd9748a..e1dd986 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -70,6 +70,13 @@ struct f2fs_mount_info {
 	unsigned int	opt;
 };
 
+#define F2FS_HAS_FEATURE(sb, mask)					\
+	((F2FS_SB(sb)->raw_super->feature & cpu_to_le32(mask)) != 0)
+#define F2FS_SET_FEATURE(sb, mask)					\
+	F2FS_SB(sb)->raw_super->feature |= cpu_to_le32(mask)
+#define F2FS_CLEAR_FEATURE(sb, mask)					\
+	F2FS_SB(sb)->raw_super->feature &= ~cpu_to_le32(mask)
+
 #define CRCPOLY_LE 0xedb88320
 
 static inline __u32 f2fs_crc32(void *buf, size_t len)
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 8d345c2..d44e97f 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -90,7 +90,8 @@ struct f2fs_super_block {
 	__le32 cp_payload;
 	__u8 version[VERSION_LEN];	/* the kernel version */
 	__u8 init_version[VERSION_LEN];	/* the initial kernel version */
-	__u8 reserved[892];		/* valid reserved region */
+	__le32 feature;			/* defined features */
+	__u8 reserved[888];		/* valid reserved region */
 } __packed;
 
 /*
-- 
2.1.1


WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 04/19] f2fs: add feature facility in superblock
Date: Fri,  1 May 2015 17:48:31 -0700	[thread overview]
Message-ID: <1430527726-68547-4-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1430527726-68547-1-git-send-email-jaegeuk@kernel.org>

This patch introduces a feature in superblock, which will indicate any new
features for f2fs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/f2fs.h          | 7 +++++++
 include/linux/f2fs_fs.h | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cd9748a..e1dd986 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -70,6 +70,13 @@ struct f2fs_mount_info {
 	unsigned int	opt;
 };
 
+#define F2FS_HAS_FEATURE(sb, mask)					\
+	((F2FS_SB(sb)->raw_super->feature & cpu_to_le32(mask)) != 0)
+#define F2FS_SET_FEATURE(sb, mask)					\
+	F2FS_SB(sb)->raw_super->feature |= cpu_to_le32(mask)
+#define F2FS_CLEAR_FEATURE(sb, mask)					\
+	F2FS_SB(sb)->raw_super->feature &= ~cpu_to_le32(mask)
+
 #define CRCPOLY_LE 0xedb88320
 
 static inline __u32 f2fs_crc32(void *buf, size_t len)
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 8d345c2..d44e97f 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -90,7 +90,8 @@ struct f2fs_super_block {
 	__le32 cp_payload;
 	__u8 version[VERSION_LEN];	/* the kernel version */
 	__u8 init_version[VERSION_LEN];	/* the initial kernel version */
-	__u8 reserved[892];		/* valid reserved region */
+	__le32 feature;			/* defined features */
+	__u8 reserved[888];		/* valid reserved region */
 } __packed;
 
 /*
-- 
2.1.1


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

  parent reply	other threads:[~2015-05-02  0:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02  0:48 [PATCH 01/19] f2fs: fix not to check IS_ERR for null pointer Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 02/19] f2fs: add missing version info in superblock Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 03/19] f2fs: move existing definitions into f2fs.h Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` Jaegeuk Kim [this message]
2015-05-02  0:48   ` [PATCH 04/19] f2fs: add feature facility in superblock Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 05/19] f2fs: add f2fs_map_blocks Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 06/19] f2fs: introduce f2fs_commit_super Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 07/19] f2fs: expose f2fs_mpage_readpages Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 08/19] f2fs: clean up f2fs_lookup Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 09/19] f2fs: add f2fs_may_inline_{data, dentry} Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 10/19] f2fs: add sbi and page pointer in f2fs_io_info Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 11/19] f2fs: move get_page for gc victims Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 12/19] f2fs: introduce dot and dotdot name check Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 13/19] f2fs: fix race on allocating and deallocating a dentry block Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 14/19] f2fs: add need_dentry_mark Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 15/19] f2fs: fix counting the number of inline_data inodes Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 16/19] f2fs: split find_data_page according to specific purposes Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 17/19] f2fs: revmove spin_lock for write_orphan_inodes Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 18/19] f2fs: introduce discard_map for f2fs_trim_fs Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim
2015-05-02  0:48 ` [PATCH 19/19] f2fs: issue discard with finally produced len and minlen Jaegeuk Kim
2015-05-02  0:48   ` Jaegeuk Kim

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=1430527726-68547-4-git-send-email-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.