]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: quota: Automatically update related qgroups or mark INCONSISTENT flags when...
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 27 Feb 2015 08:24:27 +0000 (16:24 +0800)
committerChris Mason <clm@fb.com>
Mon, 13 Apr 2015 14:52:59 +0000 (07:52 -0700)
commit8f41ebe8f7ed10f5af9929e456312f87a76409b2
tree3668997a63a88cd40d1b892dd0a7bd03f770f432
parentd7b74aecddd448bfcdbb442f69f934f6b47f60fc
btrfs: quota: Automatically update related qgroups or mark INCONSISTENT flags when assigning/deleting a qgroup relations.

Operation like qgroups assigning/deleting qgroup relations will mostly
cause qgroup data inconsistent, since it needs to do the full rescan to
determine whether shared extents are exclusive or still shared in
parent qgroups.

But there are some exceptions, like qgroup with only exclusive extents
(qgroup->excl == qgroup->rfer), in that case, we only needs to
modify all its parents' excl and rfer.

So this patch adds a quick path for such qgroup in qgroup
assign/remove routine, and if quick path failed, the qgroup status will
be marked INCONSISTENT, and return 1 to info user-land.

BTW since the quick path is much the same of qgroup_excl_accounting(),
so move the core of it to __qgroup_excl_accounting() and reuse it.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/qgroup.c