On Sat, Feb 03, 2018 at 11:30:42AM +0800, Qu Wenruo wrote: > > > On 2018年01月31日 16:52, Nikolay Borisov wrote: > > Currently btrfs_run_qgroups is doing a bit too much. Not only is it > > responsible for synchronizing in-memory state of qgroups to disk but > > it also contains code to trigger the initial qgroup rescan when > > quota is enabled initially. This condition is detected by checking that > > BTRFS_FS_QUOTA_ENABLED is not set and BTRFS_FS_QUOTA_ENABLING is set. > > Nothing really requires fro the code to be structured (and scattered) > > the way it is so let's streamline things. First move the quota rescan > > code into btrfs_quota_enable, where its invocation is closer to the > > user. This also makes the FS_QUOTA_ENABLING flag redundant so let's > > remove it as well.i > > > > This has been tested with a full xfstest run with qgroups enabled on > > the scratch device of every xfstest and no regressions were observed. > > > > Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx> > > Looks good. > > Since rescan work is async, initializing it at enable looks pretty > reasonable. > > No delaying makes it easier to read. > > > --- > > fs/btrfs/ctree.h | 1 - > > fs/btrfs/qgroup.c | 35 ++++++++++------------------------- > > 2 files changed, 10 insertions(+), 26 deletions(-) > > And indeed reduces codes. > > Reviewed-by: Qu Wenruo <wqu@xxxxxxxx> Looks good to me to, added to next. The two bits tracking the state seemed like an overkill to me. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
