aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>2014-11-20 20:14:38 -0500
committerChris Mason <clm@fb.com>2015-04-13 10:52:38 -0400
commit3eeb4d597efc9e068902057f1bd040cffc69e9e6 (patch)
treedef46e7916335d91c3a70a55d5edcdb5148101b3 /fs
parentc99f1b0c6c45d1621f08afb1352689e24a627844 (diff)
btrfs: qgroup: inherit limit info from srcgroup in creating snapshot.
Currently, when we snapshot a subvol, snapshot will not copy the limits from srcqgroup. This patch make the qgroup in snapshot inherit the limit info when create a snapshot. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/qgroup.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 37188c6b408d..34c2753fa4e1 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -2302,6 +2302,14 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
2302 dstgroup->excl_cmpr = level_size; 2302 dstgroup->excl_cmpr = level_size;
2303 srcgroup->excl = level_size; 2303 srcgroup->excl = level_size;
2304 srcgroup->excl_cmpr = level_size; 2304 srcgroup->excl_cmpr = level_size;
2305
2306 /* inherit the limit info */
2307 dstgroup->lim_flags = srcgroup->lim_flags;
2308 dstgroup->max_rfer = srcgroup->max_rfer;
2309 dstgroup->max_excl = srcgroup->max_excl;
2310 dstgroup->rsv_rfer = srcgroup->rsv_rfer;
2311 dstgroup->rsv_excl = srcgroup->rsv_excl;
2312
2305 qgroup_dirty(fs_info, dstgroup); 2313 qgroup_dirty(fs_info, dstgroup);
2306 qgroup_dirty(fs_info, srcgroup); 2314 qgroup_dirty(fs_info, srcgroup);
2307 } 2315 }