From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH v5 12/20] ext4: add fast commit on-disk format structs
Date: Mon, 9 Mar 2020 00:05:18 -0700 [thread overview]
Message-ID: <20200309070526.218202-12-harshadshirwadkar@gmail.com> (raw)
In-Reply-To: <20200309070526.218202-1-harshadshirwadkar@gmail.com>
Add structs representing on-disk format of the commit header and
tlvs in the commit header.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.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 a29ae83df881..78c5431c7aad 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 401f142172e4..761148b99b35 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -526,7 +526,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.25.1.481.gfbce0eb801-goog
next prev parent reply other threads:[~2020-03-09 7:06 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 ` [PATCH v5 02/20] ext4: add handling for extended mount options Harshad Shirwadkar
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 ` Harshad Shirwadkar [this message]
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-12-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).