[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200408215530.25649-12-harshads@google.com>
Date: Wed, 8 Apr 2020 14:55:22 -0700
From: Harshad Shirwadkar <harshadshirwadkar@...il.com>
To: linux-ext4@...r.kernel.org
Cc: tytso@....edu, Harshad Shirwadkar <harshadshirwadkar@...il.com>
Subject: [PATCH v6 12/20] ext4: add fast commit on-disk format structs
From: Harshad Shirwadkar <harshadshirwadkar@...il.com>
Add structs representing on-disk format of the commit header and
tlvs in the commit header.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@...il.com>
---
fs/ext4/ext4_jbd2.c | 1 +
fs/ext4/ext4_jbd2.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index 4bef01f9814a..fca478a3b7e9 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -4,6 +4,7 @@
*/
#include "ext4_jbd2.h"
+#include "ext4_extents.h"
#include <trace/events/ext4.h>
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index b1239d6be713..b8ac3f29949d 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -529,7 +529,52 @@ static inline int ext4_should_dioread_nolock(struct inode *inode)
return 1;
}
+/* Ext4 fast commit related info */
+
+/* Magic of fast commit header */
+#define EXT4_FC_MAGIC 0xE2540090
+
#define EXT4_NUM_FC_BLKS 128
+
+struct ext4_fc_commit_hdr {
+ /* Fast commit magic, should be EXT4_FC_MAGIC */
+ __le32 fc_magic;
+ /* Features used by this fast commit block */
+ __u8 fc_features;
+ /* Number of TLVs in this fast commmit block */
+ __le16 fc_num_tlvs;
+ /* Inode number */
+ __le32 fc_ino;
+ /* Csum(hdr+contents) */
+ __le32 fc_csum;
+};
+
+/* Fast commit on disk tag length structure */
+struct ext4_fc_tl {
+ __le16 fc_tag;
+ __le16 fc_len;
+};
+
+/* On disk fast commit tlv value structure for dirent tags:
+ * - EXT4_FC_TAG_CREATE_DENTRY
+ * - EXT4_FC_TAG_ADD_DENTRY
+ * - EXT4_FC_TAG_DEL_DENTRY
+ */
+struct ext4_fc_dentry_info {
+ __le32 fc_parent_ino;
+ __le32 fc_ino;
+ u8 fc_dname[0];
+};
+
+/*
+ * On disk fast commit tlv value structure for tag
+ * EXT4_FC_TAG_HOLE.
+ */
+struct ext4_fc_lrange {
+ __le32 fc_lblk;
+ __le32 fc_len;
+};
+
void ext4_init_fast_commit(struct super_block *sb, journal_t *journal);
void ext4_init_inode_fc_info(struct inode *inode);
void ext4_fc_track_range(struct inode *inode, ext4_lblk_t start,
--
2.26.0.110.g2183baf09c-goog
Powered by blists - more mailing lists