aboutsummaryrefslogtreecommitdiffstats
path: root/include/f2fs_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/f2fs_fs.h')
-rw-r--r--include/f2fs_fs.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 8c7c4ce..40b665d 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -745,6 +745,13 @@ struct summary_footer {
sizeof(struct sit_journal_entry))
#define SIT_JOURNAL_RESERVED ((SUM_JOURNAL_SIZE - 2) %\
sizeof(struct sit_journal_entry))
+
+/*
+ * Reserved area should make size of f2fs_extra_info equals to
+ * that of nat_journal and sit_journal.
+ */
+#define EXTRA_INFO_RESERVED (SUM_JOURNAL_SIZE - 2 - 8)
+
/*
* frequently updated NAT/SIT entries can be stored in the spare area in
* summary blocks
@@ -774,18 +781,28 @@ struct sit_journal {
__u8 reserved[SIT_JOURNAL_RESERVED];
} __attribute__((packed));
-/* 4KB-sized summary block structure */
-struct f2fs_summary_block {
- struct f2fs_summary entries[ENTRIES_IN_SUM];
+struct f2fs_extra_info {
+ __le64 kbytes_written;
+ __u8 reserved[EXTRA_INFO_RESERVED];
+} __attribute__((packed));
+
+struct f2fs_journal {
union {
__le16 n_nats;
__le16 n_sits;
};
- /* spare area is used by NAT or SIT journals */
+ /* spare area is used by NAT or SIT journals or extra info */
union {
struct nat_journal nat_j;
struct sit_journal sit_j;
+ struct f2fs_extra_info info;
};
+} __attribute__((packed));
+
+/* 4KB-sized summary block structure */
+struct f2fs_summary_block {
+ struct f2fs_summary entries[ENTRIES_IN_SUM];
+ struct f2fs_journal journal;
struct summary_footer footer;
} __attribute__((packed));