History

GFS2: Introduce new gfs2_log_header_v2

This patch adds a new structure called gfs2_log_header_v2 which is used to store expanded fields into previously unused areas of the log headers (i.e., this change is backwards compatible). Some of these are used for debug purposes so we can backtrack when problems occur. Others are reserved for future expansion. This patch is based on a prototype from Steve Whitehouse.

Bob Peterson committed 8 years ago

Commit c1696fb1 parent 0ff591615 files · +128 −59Browse files

Showing the changes to include/uapi/linux (1 of 15 files). Show all

Unified · Split

include/uapi/linux/gfs2_ondisk.h+24−2
@@ -403,7 +403,15 @@ struct gfs2_ea_header { · 402 unmodified lines
403403 * Log header structure
404404 */
405405
406−#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
406+#define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */
407+#define GFS2_LOG_HEAD_FLUSH_NORMAL 0x00000002 /* normal log flush */
408+#define GFS2_LOG_HEAD_FLUSH_SYNC 0x00000004 /* Sync log flush */
409+#define GFS2_LOG_HEAD_FLUSH_SHUTDOWN 0x00000008 /* Shutdown log flush */
410+#define GFS2_LOG_HEAD_FLUSH_FREEZE 0x00000010 /* Freeze flush */
411+#define GFS2_LOG_HEAD_RECOVERY 0x00000020 /* Journal recovery */
412+#define GFS2_LOG_HEAD_USERSPACE 0x80000000 /* Written by gfs2-utils */
413+
414+#define LH_V1_SIZE (offsetofend(struct gfs2_log_header, lh_hash))
407415
408416 struct gfs2_log_header {
409417 struct gfs2_meta_header lh_header;
@@ -412,7 +420,21 @@ struct gfs2_log_header { · 2 unmodified lines
412420 __be32 lh_flags; /* GFS2_LOG_HEAD_... */
413421 __be32 lh_tail; /* Block number of log tail */
414422 __be32 lh_blkno;
415− __be32 lh_hash;
423+ __be32 lh_hash; /* crc up to here with this field 0 */
424+
425+ /* Version 2 additional fields start here */
426+ __be32 lh_crc; /* crc32c from lh_nsec to end of block */
427+ __be32 lh_nsec; /* Nanoseconds of timestamp */
428+ __be64 lh_sec; /* Seconds of timestamp */
429+ __be64 lh_addr; /* Block addr of this log header (absolute) */
430+ __be64 lh_jinode; /* Journal inode number */
431+ __be64 lh_statfs_addr; /* Local statfs inode number */
432+ __be64 lh_quota_addr; /* Local quota change inode number */
433+
434+ /* Statfs local changes (i.e. diff from global statfs) */
435+ __be64 lh_local_total;
436+ __be64 lh_local_free;
437+ __be64 lh_local_dinodes;
416438 };
417439
418440 /*