Btrfs: creating the subvolume qgroup automatically when enabling quota

Creating the subvolume/snapshots(including root subvolume) qgroup
auotomatically when enabling quota.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
This commit is contained in:
Wang Shilong
2013-04-07 10:24:57 +00:00
committed by Josef Bacik
parent d4e3991b99
commit 7708f029dc
2 changed files with 57 additions and 0 deletions

View File

@@ -3697,6 +3697,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
goto drop_write;
}
down_write(&root->fs_info->subvol_sem);
if (sa->cmd != BTRFS_QUOTA_CTL_RESCAN) {
trans = btrfs_start_transaction(root, 2);
if (IS_ERR(trans)) {
@@ -3730,6 +3731,7 @@ static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg)
}
out:
kfree(sa);
up_write(&root->fs_info->subvol_sem);
drop_write:
mnt_drop_write_file(file);
return ret;