]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: move the minimum agno checks into xfs_alloc_vextent_check_args
authorDave Chinner <dchinner@redhat.com>
Tue, 9 May 2023 09:30:32 +0000 (11:30 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 10 May 2023 12:41:46 +0000 (14:41 +0200)
commit50f6a20b8b826c3e7adfdcf3f209007d418e2341
treee684c4c4821d1f5fd766344b0c9f218d8efd0126
parent32cd26bf590dbdabeb2b13d7e1592c9624a0ee8b
xfs: move the minimum agno checks into xfs_alloc_vextent_check_args

Source kernel commit: 8b81356825ffb96b3b167b4dabbbbdb506bb0e0b

All of the allocation functions now extract the minimum allowed AG
from the transaction and then use it in some way. The allocation
functions that are restricted to a single AG all check if the
AG requested can be allocated from and return an error if so. These
all set args->agno appropriately.

All the allocation functions that iterate AGs use it to calculate
the scan start AG. args->agno is not set until the iterator starts
walking AGs.

Hence we can easily set up a conditional check against the minimum
AG allowed in xfs_alloc_vextent_check_args() based on whether
args->agno contains NULLAGNUMBER or not and move all the repeated
setup code to xfs_alloc_vextent_check_args(), further simplifying
the allocation functions.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_alloc.c