Hi all, Now that we've cleaned up some code warts in the deferred work item processing code, let's make intent items take an active perag reference from their creation until they are finally freed by the defer ops machinery. This change facilitates the scrub drain in the next patchset and will make it easier for the future AG removal code to detect a busy AG in need of quiescing. If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=intents-perag-refs xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=intents-perag-refs --- fs/xfs/libxfs/xfs_ag.c | 6 +--- fs/xfs/libxfs/xfs_alloc.c | 22 +++++++-------- fs/xfs/libxfs/xfs_alloc.h | 12 ++++++-- fs/xfs/libxfs/xfs_bmap.c | 1 + fs/xfs/libxfs/xfs_bmap.h | 4 +++ fs/xfs/libxfs/xfs_ialloc_btree.c | 7 +++-- fs/xfs/libxfs/xfs_refcount.c | 33 +++++++++------------- fs/xfs/libxfs/xfs_refcount.h | 4 +++ fs/xfs/libxfs/xfs_refcount_btree.c | 5 ++- fs/xfs/libxfs/xfs_rmap.c | 29 +++++++------------ fs/xfs/libxfs/xfs_rmap.h | 4 +++ fs/xfs/scrub/repair.c | 3 +- fs/xfs/xfs_bmap_item.c | 29 +++++++++++++++++++ fs/xfs/xfs_extfree_item.c | 54 +++++++++++++++++++++++++----------- fs/xfs/xfs_refcount_item.c | 36 +++++++++++++++++++++--- fs/xfs/xfs_rmap_item.c | 32 +++++++++++++++++++-- 16 files changed, 196 insertions(+), 85 deletions(-)