History

Merge tag 'gfs2-4.16.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2

Pull GFS2 updates from Bob Peterson: "We've got 30 patches for this merge window. These generally fall into five categories: - code cleanups - patches related to adding PUNCH_HOLE support to GFS2 - support for new fields in resource group headers - a few bug fixes - support for new fields in journal log headers. These new fields, which were previously unused, are designed to make it easier to track down file system corruption, and allow fsck.gfs2 to make more intelligent decisions when finding and fixing file system corruption. Details: - Two patches from Abhi Das, to trim the ordered writes list, which used to grow uncontrollably until unmount. - Several patches from Andreas Gruenbacher: remove an unused parameter from function gfs2_write_jdata_pagevec, remove a pointless BUG_ON, clean up an error patch in trunc_start, remove some unused parameters from truncate, make gfs2_journaled_truncate more efficient, clean up the support functions for truncate, fix metadata read-ahead for truncate to make it faster, fix up the non-recursive truncate code, rework and rename gfs2_block_truncate_page, generalize the non-recursive truncate code so it can take a range of values for punch_hole support, introduce new PUNCH_HOLE support that take advantage of the previous patches, add fallocate support with PUNCH_HOLE, fix some typos in the comments, add the function gfs2_max_stuffed_size to replace a piece of code that was needlessly repeated throughout GFS2, a minor cleanup to function gfs2_page_add_databufs, get rid of function gfs2_log_header_in in preparation for the new log header fields, and also fix up some missing newlines in kernel messages. - Andy Price added a new field to resource groups to indicate where the next one should be, to allow fsck.gfs2 to make better repairs. He also added new rindex fields for consistency checking, and added a crc field to resource group headers for consistency checking. - I reduced redundancy in functions common to freeing dinodes, and when writing log headers between the journalling code and journal recovery code. Also added new fields to journal log headers based on a prototype from Steve Whitehouse, and log the source of journal log headers so we can better track down journal corruption. Minor comment typo fix and a fix for a BUG in an unlink error path. - Steve Whitehouse contributed a patch to fix an incorrect use of the gfs2_blk2rgrpd function. - Tetsuo Handa contributed a patch that fixes incorrect error handling in function init_gfs2_fs" * tag 'gfs2-4.16.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (30 commits) gfs2: Add a few missing newlines in messages gfs2: Remove inode from ordered write list in gfs2_write_inode() GFS2: Don't try to end a non-existent transaction in unlink GFS2: Fix minor comment typo GFS2: Log the reason for log flushes in every log header GFS2: Introduce new gfs2_log_header_v2 gfs2: Get rid of gfs2_log_header_in gfs2: Minor gfs2_page_add_databufs cleanup gfs2: Add gfs2_max_stuffed_size gfs2: Typo fixes gfs2: Implement fallocate(FALLOC_FL_PUNCH_HOLE) gfs2: Turn trunc_dealloc into punch_hole gfs2: Generalize truncate code Turn gfs2_block_truncate_page into gfs2_block_zero_range gfs2: Improve non-recursive delete algorithm gfs2: Fix metadata read-ahead during truncate gfs2: Clean up {lookup,fillup}_metapath gfs2: Remove minor gfs2_journaled_truncate inefficiencies gfs2: truncate: Remove unnecessary oldsize parameters gfs2: Clean up trunc_start error path ...

Linus Torvalds committed 8 years ago

Commit 26064ea2 parents c9cc8d0 af3881624 files · +758 −427Browse files

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

Unified · Split

include/uapi/linux/gfs2_ondisk.h+57−5
@@ -187,10 +187,19 @@ struct gfs2_rgrp { · 186 unmodified lines
187 __be32 rg_flags;187 __be32 rg_flags;
188 __be32 rg_free;188 __be32 rg_free;
189 __be32 rg_dinodes;189 __be32 rg_dinodes;
190 __be32 __pad;190 union {
191 __be32 __pad;
192 __be32 rg_skip; /* Distance to the next rgrp in fs blocks */
193 };
191 __be64 rg_igeneration;194 __be64 rg_igeneration;
192 195 /* The following 3 fields are duplicated from gfs2_rindex to reduce
193 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */196 reliance on the rindex */
197 __be64 rg_data0; /* First data location */
198 __be32 rg_data; /* Number of data blocks in rgrp */
199 __be32 rg_bitbytes; /* Number of bytes in data bitmaps */
200 __be32 rg_crc; /* crc32 of the structure with this field 0 */
201
202 __u8 rg_reserved[60]; /* Several fields from gfs1 now reserved */
194};203};
195 204
196/*205/*
@@ -394,7 +403,36 @@ struct gfs2_ea_header { · 197 unmodified lines
394 * Log header structure403 * Log header structure
395 */404 */
396 405
397#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/* Log flush callers */
415#define GFS2_LFC_SHUTDOWN 0x00000100
416#define GFS2_LFC_JDATA_WPAGES 0x00000200
417#define GFS2_LFC_SET_FLAGS 0x00000400
418#define GFS2_LFC_AIL_EMPTY_GL 0x00000800
419#define GFS2_LFC_AIL_FLUSH 0x00001000
420#define GFS2_LFC_RGRP_GO_SYNC 0x00002000
421#define GFS2_LFC_INODE_GO_SYNC 0x00004000
422#define GFS2_LFC_INODE_GO_INVAL 0x00008000
423#define GFS2_LFC_FREEZE_GO_SYNC 0x00010000
424#define GFS2_LFC_KILL_SB 0x00020000
425#define GFS2_LFC_DO_SYNC 0x00040000
426#define GFS2_LFC_INPLACE_RESERVE 0x00080000
427#define GFS2_LFC_WRITE_INODE 0x00100000
428#define GFS2_LFC_MAKE_FS_RO 0x00200000
429#define GFS2_LFC_SYNC_FS 0x00400000
430#define GFS2_LFC_EVICT_INODE 0x00800000
431#define GFS2_LFC_TRANS_END 0x01000000
432#define GFS2_LFC_LOGD_JFLUSH_REQD 0x02000000
433#define GFS2_LFC_LOGD_AIL_FLUSH_REQD 0x04000000
434
435#define LH_V1_SIZE (offsetofend(struct gfs2_log_header, lh_hash))
398 436
399struct gfs2_log_header {437struct gfs2_log_header {
400 struct gfs2_meta_header lh_header;438 struct gfs2_meta_header lh_header;
@@ -403,7 +441,21 @@ struct gfs2_log_header { · 2 unmodified lines
403 __be32 lh_flags; /* GFS2_LOG_HEAD_... */441 __be32 lh_flags; /* GFS2_LOG_HEAD_... */
404 __be32 lh_tail; /* Block number of log tail */442 __be32 lh_tail; /* Block number of log tail */
405 __be32 lh_blkno;443 __be32 lh_blkno;
406 __be32 lh_hash;444 __be32 lh_hash; /* crc up to here with this field 0 */
445
446 /* Version 2 additional fields start here */
447 __be32 lh_crc; /* crc32c from lh_nsec to end of block */
448 __be32 lh_nsec; /* Nanoseconds of timestamp */
449 __be64 lh_sec; /* Seconds of timestamp */
450 __be64 lh_addr; /* Block addr of this log header (absolute) */
451 __be64 lh_jinode; /* Journal inode number */
452 __be64 lh_statfs_addr; /* Local statfs inode number */
453 __be64 lh_quota_addr; /* Local quota change inode number */
454
455 /* Statfs local changes (i.e. diff from global statfs) */
456 __be64 lh_local_total;
457 __be64 lh_local_free;
458 __be64 lh_local_dinodes;
407};459};
408 460
409/*461/*