]> git.ipfire.org Git - people/ms/linux.git/commit - fs/xfs/libxfs/xfs_alloc.c
xfs: refactor cntbt lastblock scan best extent logic into helper
authorBrian Foster <bfoster@redhat.com>
Mon, 14 Oct 2019 00:10:33 +0000 (17:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 21 Oct 2019 16:04:58 +0000 (09:04 -0700)
commit396bbf3c657e540162b7297e426e5939c2909854
treea43a7d5cbd91f334c1d45820a3cff2157ae5dee7
parentc62321a2a0ea3c53ab7a41cf4d4071ee37bcc2c0
xfs: refactor cntbt lastblock scan best extent logic into helper

The cntbt lastblock scan checks the size, alignment, locality, etc.
of each free extent in the block and compares it with the current
best candidate. This logic will be reused by the upcoming optimized
cntbt algorithm, so refactor it into a separate helper. Note that
acur->diff is now initialized to -1 (unsigned) instead of 0 to
support the more granular comparison logic in the new helper.

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>
fs/xfs/libxfs/xfs_alloc.c
fs/xfs/xfs_trace.h