OSDN Git Service

xfs: introduce allocation cursor data structure
authorBrian Foster <bfoster@redhat.com>
Mon, 14 Oct 2019 00:10:31 +0000 (17:10 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 21 Oct 2019 16:04:58 +0000 (09:04 -0700)
commitf5e7dbea1e3ecc27f05e8cc83614c206903cc97a
treef7629a104f45a6e1a255e73dcc27e76b61cb84d5
parentf6b428a46d60186a38105c71fa435f31240721f9
xfs: introduce allocation cursor data structure

Introduce a new allocation cursor data structure to encapsulate the
various states and structures used to perform an extent allocation.
This structure will eventually be used to track overall allocation
state across different search algorithms on both free space btrees.

To start, include the three btree cursors (one for the cntbt and two
for the bnobt left/right search) used by the near mode allocation
algorithm and refactor the cursor setup and teardown code into
helpers. This slightly changes cursor memory allocation patterns,
but otherwise makes no functional changes to the allocation
algorithm.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: fix sparse complaints]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/libxfs/xfs_alloc.c