diff options
author | Dave Chinner <dchinner@redhat.com> | 2023-02-13 01:14:53 +0300 |
---|---|---|
committer | Dave Chinner <dchinner@redhat.com> | 2023-02-13 01:14:53 +0300 |
commit | 2a7f6d41d8b72412228ede538bdf0e81bf9738f4 (patch) | |
tree | caa513dbfa286d2420eb4f750aaaed9dc61b71e2 /fs/xfs/libxfs/xfs_alloc.h | |
parent | 319c9e874ac8721acdb6583e3459ef595e5ed0a6 (diff) | |
download | linux-2a7f6d41d8b72412228ede538bdf0e81bf9738f4.tar.xz |
xfs: use xfs_alloc_vextent_start_bno() where appropriate
Change obvious callers of single AG allocation to use
xfs_alloc_vextent_start_bno(). Callers no long need to specify
XFS_ALLOCTYPE_START_BNO, and so the type can be driven inward and
removed.
While doing this, also pass the allocation target fsb as a parameter
rather than encoding it in args->fsbno.
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 | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.h b/fs/xfs/libxfs/xfs_alloc.h index 9be46f493340..80e2c16f4cde 100644 --- a/fs/xfs/libxfs/xfs_alloc.h +++ b/fs/xfs/libxfs/xfs_alloc.h @@ -20,7 +20,6 @@ unsigned int xfs_agfl_size(struct xfs_mount *mp); * Freespace allocation types. Argument to xfs_alloc_[v]extent. */ #define XFS_ALLOCTYPE_THIS_AG 0x08 /* anywhere in this a.g. */ -#define XFS_ALLOCTYPE_START_BNO 0x10 /* near this block else anywhere */ #define XFS_ALLOCTYPE_NEAR_BNO 0x20 /* in this a.g. and near this block */ #define XFS_ALLOCTYPE_THIS_BNO 0x40 /* at exactly this block */ @@ -29,7 +28,6 @@ typedef unsigned int xfs_alloctype_t; #define XFS_ALLOC_TYPES \ { XFS_ALLOCTYPE_THIS_AG, "THIS_AG" }, \ - { XFS_ALLOCTYPE_START_BNO, "START_BNO" }, \ { XFS_ALLOCTYPE_NEAR_BNO, "NEAR_BNO" }, \ { XFS_ALLOCTYPE_THIS_BNO, "THIS_BNO" } @@ -129,6 +127,17 @@ xfs_alloc_vextent( int xfs_alloc_vextent_this_ag(struct xfs_alloc_arg *args); /* + * Best effort full filesystem allocation scan. + * + * Locality aware allocation will be attempted in the initial AG, but on failure + * non-localised attempts will be made. The AGs are constrained by previous + * allocations in the current transaction. Two passes will be made - the first + * non-blocking, the second blocking. + */ +int xfs_alloc_vextent_start_ag(struct xfs_alloc_arg *args, + xfs_fsblock_t target); + +/* * Iterate from the AG indicated from args->fsbno through to the end of the * filesystem attempting blocking allocation. This is for use in last * resort allocation attempts when everything else has failed. |