• Brian Foster's avatar
    xfs: add quota-driven speculative preallocation throttling · 76a4202a
    Brian Foster authored
    Introduce the need_throttle() and calc_throttle() functions to
    independently check whether throttling is required for a particular
    dquot and if so, calculate the associated throttling metrics based
    on the state of the quota. We use the same general algorithm to
    calculate the throttle shift as for global free space with the
    exception of using three stages rather than five.
    
    Update xfs_iomap_prealloc_size() to use the smallest available
    prealloc size based on each of the constraints and apply the
    maximum shift to obtain the throttled preallocation size.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    76a4202a
xfs_iomap.c 24.5 KB