diff options
author | Dave Chinner <dchinner@redhat.com> | 2023-02-13 09:14:54 +1100 |
---|---|---|
committer | Dave Chinner <dchinner@redhat.com> | 2023-02-13 09:14:54 +1100 |
commit | db4710fd12248e5d4c3842520cd13f034136576b (patch) | |
tree | 140a8b7168b32dbf46a8040d1e48e162a527a00b /fs/xfs/libxfs/xfs_alloc.h | |
parent | 2a7f6d41d8b72412228ede538bdf0e81bf9738f4 (diff) | |
download | linux-db4710fd12248e5d4c3842520cd13f034136576b.tar.gz linux-db4710fd12248e5d4c3842520cd13f034136576b.tar.bz2 linux-db4710fd12248e5d4c3842520cd13f034136576b.zip |
xfs: introduce xfs_alloc_vextent_near_bno()
The remaining callers of xfs_alloc_vextent() are all doing NEAR_BNO
allocations. We can replace that function with a new
xfs_alloc_vextent_near_bno() function that does this explicitly.
We also multiplex NEAR_BNO allocations through
xfs_alloc_vextent_this_ag via args->type. Replace all of these with
direct calls to xfs_alloc_vextent_near_bno(), too.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_alloc.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h index 80e2c16f4cde..45a428e770f0 100644 --- a/fs/xfs/libxfs/xfs_alloc.h +++ b/fs/xfs/libxfs/xfs_alloc.h @@ -114,19 +114,19 @@ xfs_alloc_log_agf( uint32_t fields);/* mask of fields to be logged (XFS_AGF_...) */ /* - * Allocate an extent (variable-size). - */ -int /* error */ -xfs_alloc_vextent( - xfs_alloc_arg_t *args); /* allocation argument structure */ - -/* * Allocate an extent in the specific AG defined by args->fsbno. If there is no * space in that AG, then the allocation will fail. */ int xfs_alloc_vextent_this_ag(struct xfs_alloc_arg *args); /* + * Allocate an extent as close to the target as possible. If there are not + * viable candidates in the AG, then fail the allocation. + */ +int xfs_alloc_vextent_near_bno(struct xfs_alloc_arg *args, + xfs_fsblock_t target); + +/* * Best effort full filesystem allocation scan. * * Locality aware allocation will be attempted in the initial AG, but on failure |