Btrfs: Introduce global metadata reservation
Reserve metadata space for extent tree, checksum tree and root tree Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
@ -117,13 +117,14 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
|
||||
path->nodes[1], 0,
|
||||
cache_only, &last_ret,
|
||||
&root->defrag_progress);
|
||||
WARN_ON(ret && ret != -EAGAIN);
|
||||
if (ret) {
|
||||
WARN_ON(ret == -EAGAIN);
|
||||
goto out;
|
||||
}
|
||||
if (next_key_ret == 0) {
|
||||
memcpy(&root->defrag_progress, &key, sizeof(key));
|
||||
ret = -EAGAIN;
|
||||
}
|
||||
|
||||
btrfs_release_path(root, path);
|
||||
out:
|
||||
if (path)
|
||||
btrfs_free_path(path);
|
||||
|
Reference in New Issue
Block a user