]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: add quota-driven speculative preallocation throttling
authorBrian Foster <bfoster@redhat.com>
Mon, 18 Mar 2013 14:51:47 +0000 (10:51 -0400)
committerBen Myers <bpm@sgi.com>
Fri, 22 Mar 2013 21:07:21 +0000 (16:07 -0500)
commitc3e722c21576b8c67a1003c825dc049d52c805eb
treec10ea589bed0223d520d3ff843dd65a7e72c5115
parentf4452b812439209d3b40458a9c7d10a7152ff31b
xfs: add quota-driven speculative preallocation throttling

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: Brian Foster <bfoster@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_iomap.c