• Dave Chinner's avatar
    xfs: move the minimum agno checks into xfs_alloc_vextent_check_args · 8b813568
    Dave Chinner authored
    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: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    8b813568
xfs_alloc.c 99.2 KB