aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 11:46:56 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 11:46:56 -0700
commitaa26690fab1380735442e027ce4b17849a24493f (patch)
treeca1e8ca369f4b6afe52ff793f31a3b5b10f7d8b1 /fs/xfs/xfs_mount.h
parentMerge tag 'iomap-5.2-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff)
parentxfs: change some error-less functions to void types (diff)
downloadlinux-dev-aa26690fab1380735442e027ce4b17849a24493f.tar.xz
linux-dev-aa26690fab1380735442e027ce4b17849a24493f.zip
Merge tag 'xfs-5.2-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs updates from Darrick Wong: "Here's a big pile of new stuff for XFS for 5.2. XFS has grown the ability to report metadata health status to userspace after online fsck checks the filesystem. The online metadata checking code is (I really hope) feature complete with the addition of checks for the global fs counters, though it'll remain EXPERIMENTAL for now. There are also fixes for thundering herds of writeback completions and some other deadlocks, fixes for theoretical integer overflow attacks on space accounting, and removal of the long-defunct 'mntpt' option which was deprecated in the mid-2000s and (it turns out) totally broken since 2011 (and nobody complained...). Summary: - Fix some more buffer deadlocks when performing an unmount after a hard shutdown. - Fix some minor space accounting issues. - Fix some use after free problems. - Make the (undocumented) FITRIM behavior consistent with other filesystems. - Embiggen the xfs geometry ioctl's data structure. - Introduce a new AG geometry ioctl. - Introduce a new online health reporting infrastructure and ioctl for userspace to query a filesystem's health status. - Enhance online scrub and repair to update the health reports. - Reduce thundering herd problems when writeback io completes. - Fix some transaction reservation type errors. - Fix integer overflow problems with delayed alloc reservation counters. - Fix some problems where we would exit to userspace without unlocking. - Fix inconsistent behavior when finishing deferred ops fails. - Strengthen scrub to check incore data against ondisk metadata. - Remove long-broken mntpt mount option. - Add an online scrub function for the filesystem summary counters, which should make online metadata scrub more or less feature complete for now. - Various cleanups" * tag 'xfs-5.2-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (38 commits) xfs: change some error-less functions to void types xfs: add online scrub for superblock counters xfs: don't parse the mtpt mount option xfs: always rejoin held resources during defer roll xfs: add missing error check in xfs_prepare_shift() xfs: scrub should check incore counters against ondisk headers xfs: allow scrubbers to pause background reclaim xfs: rename the speculative block allocation reclaim toggle functions xfs: track delayed allocation reservations across the filesystem xfs: fix broken bhold behavior in xrep_roll_ag_trans xfs: unlock inode when xfs_ioctl_setattr_get_trans can't get transaction xfs: kill the xfs_dqtrx_t typedef xfs: widen inode delalloc block counter to 64-bits xfs: widen quota block counters to 64-bit integers xfs: abort unaligned nowait directio early xfs: assert that we don't enter agfl freeing with a non-permanent transaction xfs: make tr_growdata a permanent transaction xfs: merge adjacent io completions of the same type xfs: remove unused m_data_workqueue xfs: implement per-inode writeback completion queues ...
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r--fs/xfs/xfs_mount.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 110f927cf943..c81a5cd7c228 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -60,6 +60,20 @@ struct xfs_error_cfg {
typedef struct xfs_mount {
struct super_block *m_super;
xfs_tid_t m_tid; /* next unused tid for fs */
+
+ /*
+ * Bitsets of per-fs metadata that have been checked and/or are sick.
+ * Callers must hold m_sb_lock to access these two fields.
+ */
+ uint8_t m_fs_checked;
+ uint8_t m_fs_sick;
+ /*
+ * Bitsets of rt metadata that have been checked and/or are sick.
+ * Callers must hold m_sb_lock to access this field.
+ */
+ uint8_t m_rt_checked;
+ uint8_t m_rt_sick;
+
struct xfs_ail *m_ail; /* fs active log item list */
struct xfs_sb m_sb; /* copy of fs superblock */
@@ -67,6 +81,12 @@ typedef struct xfs_mount {
struct percpu_counter m_icount; /* allocated inodes counter */
struct percpu_counter m_ifree; /* free inodes counter */
struct percpu_counter m_fdblocks; /* free block counter */
+ /*
+ * Count of data device blocks reserved for delayed allocations,
+ * including indlen blocks. Does not include allocated CoW staging
+ * extents or anything related to the rt device.
+ */
+ struct percpu_counter m_delalloc_blks;
struct xfs_buf *m_sb_bp; /* buffer for superblock */
char *m_fsname; /* filesystem name */
@@ -175,7 +195,6 @@ typedef struct xfs_mount {
struct xstats m_stats; /* per-fs stats */
struct workqueue_struct *m_buf_workqueue;
- struct workqueue_struct *m_data_workqueue;
struct workqueue_struct *m_unwritten_workqueue;
struct workqueue_struct *m_cil_workqueue;
struct workqueue_struct *m_reclaim_workqueue;
@@ -214,7 +233,6 @@ typedef struct xfs_mount {
must be synchronous except
for space allocations */
#define XFS_MOUNT_UNMOUNTING (1ULL << 1) /* filesystem is unmounting */
-#define XFS_MOUNT_BAD_SUMMARY (1ULL << 2) /* summary counters are bad */
#define XFS_MOUNT_WAS_CLEAN (1ULL << 3)
#define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem
operations, typically for
@@ -369,6 +387,15 @@ typedef struct xfs_perag {
xfs_agino_t pagl_pagino;
xfs_agino_t pagl_leftrec;
xfs_agino_t pagl_rightrec;
+
+ /*
+ * Bitsets of per-ag metadata that have been checked and/or are sick.
+ * Callers should hold pag_state_lock before accessing this field.
+ */
+ uint16_t pag_checked;
+ uint16_t pag_sick;
+ spinlock_t pag_state_lock;
+
spinlock_t pagb_lock; /* lock for pagb_tree */
struct rb_root pagb_tree; /* ordered tree of busy extents */
unsigned int pagb_gen; /* generation count for pagb_tree */
@@ -454,5 +481,6 @@ int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
struct xfs_error_cfg * xfs_error_get_cfg(struct xfs_mount *mp,
int error_class, int error);
void xfs_force_summary_recalc(struct xfs_mount *mp);
+void xfs_mod_delalloc(struct xfs_mount *mp, int64_t delta);
#endif /* __XFS_MOUNT_H__ */