mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Add support for defragging files via btrfsctl -d. Avoid OOM on extent tree
defrag. Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
8e21528f87
commit
86479a04ee
5 changed files with 100 additions and 18 deletions
|
@ -113,6 +113,8 @@ static int defrag_walk_down(struct btrfs_trans_handle *trans,
|
|||
}
|
||||
WARN_ON(*level < 0);
|
||||
WARN_ON(*level >= BTRFS_MAX_LEVEL);
|
||||
clear_buffer_defrag(path->nodes[*level]);
|
||||
clear_buffer_defrag_done(path->nodes[*level]);
|
||||
btrfs_block_release(root, path->nodes[*level]);
|
||||
path->nodes[*level] = NULL;
|
||||
*level += 1;
|
||||
|
@ -143,6 +145,7 @@ static int defrag_walk_up(struct btrfs_trans_handle *trans,
|
|||
return 0;
|
||||
} else {
|
||||
clear_buffer_defrag(path->nodes[*level]);
|
||||
clear_buffer_defrag_done(path->nodes[*level]);
|
||||
btrfs_block_release(root, path->nodes[*level]);
|
||||
path->nodes[*level] = NULL;
|
||||
*level = i + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue