Hi,
On 02/01/18 17:15, Steven Whitehouse wrote:
Hi,
On 02/01/18 17:01, Bob Peterson wrote:
[snip]
diff --git a/include/uapi/linux/gfs2_ondisk.h
b/include/uapi/linux/gfs2_ondisk.h
index 09f0920f07e9..e68789a27ff1 100644
--- a/include/uapi/linux/gfs2_ondisk.h
+++ b/include/uapi/linux/gfs2_ondisk.h
@@ -403,7 +403,13 @@ struct gfs2_ea_header {
* Log header structure
*/
-#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
+#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
+#define GFS2_LOG_HEAD_FLUSH_NORMAL 0x00000002 /* normal log flush */
+#define GFS2_LOG_HEAD_FLUSH_SYNC 0x00000004 /* Sync log flush */
+#define GFS2_LOG_HEAD_FLUSH_SHUTDOWN 0x00000008 /* Shutdown log
flush */
+#define GFS2_LOG_HEAD_FLUSH_FREEZE 0x00000010 /* Freeze flush */
+#define GFS2_LOG_HEAD_RECOVERY 0x00000020 /* Journal recovery */
+#define GFS2_LOG_HEAD_USERSPACE 0x80000000 /* Written by
gfs2-utils */
struct gfs2_log_header {
struct gfs2_meta_header lh_header;
@@ -415,6 +421,24 @@ struct gfs2_log_header {
__be32 lh_hash;
};
+struct gfs2_log_header_v2 {
+ struct gfs2_log_header lhv1;
+
+ __be32 lh_crc; /* crc32 of whole block with this field 0 */
+ __be32 lh_nsec; /* Nano second time stamp */
+ __be64 lh_sec; /* Second based time stamp */
+ __be64 lh_addr; /* Block number of this log header
(absolute) */
+ __be64 lh_jinode; /* Journal inode number */
+ __be64 lh_statfs_addr; /* Local statfs inode number */
+ __be64 lh_quota_addr; /* Local quota change inode number */
+
+ /* Statfs local changes (i.e. diff from global statfs) */
+ __be64 lh_local_total;
+ __be64 lh_local_free;
+ __be64 lh_local_dinodes;
+ __be32 lh_log_origin; /* The origin of this log header */
+};
+
/*
* Log type descriptor
*/
Also, I've just noticed that we don't need a v2 structure here. We
should just be able to add the new fields in to the existing structure
without any problems. There is nothing that comes after the header in
the journal header blocks, so we are free to extend the structure as
much as we want to with the only constraint being that sizeof(struct
gfs2_log_header) <= 512, unlike the other metadata structures. That
should simplify the code a bit, and avoid the need for structure
versions here,
Steve.