• Brian Foster's avatar
    xfs: refactor inode chunk alloc/free tx reservation · 57af33e4
    Brian Foster authored
    The reservation for the various forms of inode allocation is
    scattered across several different functions. This includes two
    variants of chunk allocation (v5 icreate transactions vs. older
    create transactions) and the inode free transaction.
    
    To clean up some of this code and clarify the purpose of specific
    allocfree reservations, continue the pattern of defining helper
    functions for smaller operational units of broader transactions.
    Refactor the reservation into an inode chunk alloc/free helper that
    considers the various conditions based on filesystem format.
    
    An inode chunk free involves an extent free and buffer
    invalidations. The latter requires reservation for log headers only.
    An inode chunk allocation modifies the free space btrees and logs
    the chunk on v4 supers. v5 supers initialize the inode chunk using
    ordered buffers and so do not log the chunk.
    
    As a side effect of this refactoring, add one more allocfree res to
    the ifree transaction. Technically this does not serve a specific
    purpose because inode chunks are freed via deferred operations and
    thus occur after a transaction roll. tr_ifree has a bit of a history
    of tx overruns caused by too many agfl fixups during sustained file
    deletion workloads, so add this extra reservation as a form of
    padding nonetheless.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    57af33e4
xfs_trans_resv.c 30.1 KB