]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: support bulk loading of staged btrees
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 11 Mar 2020 17:51:50 +0000 (10:51 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 18 Mar 2020 15:12:23 +0000 (08:12 -0700)
commit6be2b40efdd1ed6cc55012484d185f1075bc27c9
tree824eba74a6ace7294350af322ef03e48bd0c627a
parent14ded22278eaa8c6b1212d02055b949bb88b497d
xfs: support bulk loading of staged btrees

Add a new btree function that enables us to bulk load a btree cursor.
This will be used by the upcoming online repair patches to generate new
btrees.  This avoids the programmatic inefficiency of calling
xfs_btree_insert in a loop (which generates a lot of log traffic) in
favor of stamping out new btree blocks with ordered buffers, and then
committing both the new root and scheduling the removal of the old btree
blocks in a single transaction commit.

The design of this new generic code is based off the btree rebuilding
code in xfs_repair's phase 5 code, with the explicit goal of enabling us
to share that code between scrub and repair.  It has the additional
feature of being able to control btree block loading factors.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_btree_staging.c
fs/xfs/libxfs/xfs_btree_staging.h
fs/xfs/xfs_trace.c
fs/xfs/xfs_trace.h