]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: refactor and reuse best extent scanning logic
authorBrian Foster <bfoster@redhat.com>
Thu, 16 Jan 2020 22:13:32 +0000 (17:13 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 16 Jan 2020 22:13:32 +0000 (17:13 -0500)
commit4f2eee5af5966ede4c8540373663c1f17d02a8b0
tree6ed7ad2fff7a9ee2d826a2f15e7ce5d6b264a18e
parent46f7e3231e35d3169a233dbf56aa98a8d0a516f4
xfs: refactor and reuse best extent scanning logic

Source kernel commit: 78d7aabdeea38368dc5e0aff2d3d1c353a7ab344

The bnobt "find best" helper implements a simple btree walker
function. This general pattern, or a subset thereof, is reused in
various parts of a near mode allocation operation. For example, the
bnobt left/right scans are each iterative btree walks along with the
cntbt lastblock scan.

Rework this function into a generic btree walker, add a couple
parameters to control termination behavior from various contexts and
reuse it where applicable.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc.c