]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fallocate: Add support to accurate qgroup reserve
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 8 Sep 2015 09:22:44 +0000 (17:22 +0800)
committerChris Mason <clm@fb.com>
Thu, 22 Oct 2015 01:41:09 +0000 (18:41 -0700)
commit4554282e1572351b0b8f64381d6b519918fd0e89
tree37b35570c661440843159df5a7ce255c6aa912fa
parent5c9daaeef50ed74a8496bb4a53ba352cb9deae2e
btrfs: fallocate: Add support to accurate qgroup reserve

Now fallocate will do accurate qgroup reserve space check, unlike old
method, which will always reserve the whole length of the range.

With this patch, fallocate will:
1) Iterate the desired range and mark in data rsv map
   Only range which is going to be allocated will be recorded in data
   rsv map and reserve the space.
   For already allocated range (normal/prealloc extent) they will be
   skipped.
   Also, record the marked range into a new list for later use.

2) If 1) succeeded, do real file extent allocate.
   And at file extent allocation time, corresponding range will be
   removed from the range in data rsv map.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file.c