]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: allow fallocate to max out quotas/fs efficiently
authorAbhi Das <adas@redhat.com>
Wed, 18 Mar 2015 17:05:15 +0000 (12:05 -0500)
committerBob Peterson <rpeterso@redhat.com>
Wed, 18 Mar 2015 17:48:02 +0000 (12:48 -0500)
commit6146a9f3cf945d929c0207db1daaa4ea2714cf7c
tree4ead90ff02660236e445fe0666f5c57e39761e67
parent7844b553b28b5be086fb94f6b6b61c09f495c6f0
gfs2: allow fallocate to max out quotas/fs efficiently

We can quickly get an estimate of how many blocks are available
for allocation restricted by quota and fs size respectively, using
the ap->allowed field in the gfs2_alloc_parms structure.
gfs2_quota_check() and gfs2_inplace_reserve() provide these values.

Once we have the total number of blocks available to us, we can
compute how many bytes of data can be written using those blocks
instead of guessing inefficiently.

Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/file.c