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_bmap.c | |
parent | 2a7f6d41d8b72412228ede538bdf0e81bf9738f4 (diff) | |
download | lwn-db4710fd12248e5d4c3842520cd13f034136576b.tar.gz lwn-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_bmap.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 94826f35fdae..da5809d3d004 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -3246,7 +3246,6 @@ xfs_bmap_btalloc_filestreams( int notinit = 0; int error; - args->type = XFS_ALLOCTYPE_NEAR_BNO; args->total = ap->total; start_agno = XFS_FSB_TO_AGNO(mp, ap->blkno); @@ -3565,7 +3564,7 @@ xfs_bmap_btalloc_at_eof( } if (ag_only) - error = xfs_alloc_vextent(args); + error = xfs_alloc_vextent_near_bno(args, ap->blkno); else error = xfs_alloc_vextent_start_ag(args, ap->blkno); if (error) @@ -3612,7 +3611,6 @@ xfs_bmap_btalloc_best_length( ap->blkno = XFS_INO_TO_FSB(mp, ap->ip->i_ino); } xfs_bmap_adjacent(ap); - args->fsbno = ap->blkno; /* * Search for an allocation group with a single extent large enough for @@ -3653,7 +3651,7 @@ xfs_bmap_btalloc_best_length( } if (is_filestream) - error = xfs_alloc_vextent(args); + error = xfs_alloc_vextent_near_bno(args, ap->blkno); else error = xfs_alloc_vextent_start_ag(args, ap->blkno); if (error) |