mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
Btrfs: Disable tree defrag in SSD mode
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
df68b8a7ad
commit
9afbb0b752
2 changed files with 5 additions and 1 deletions
|
@ -1835,7 +1835,8 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
|
|||
buf->start, buf->start + buf->len - 1,
|
||||
EXTENT_CSUM, GFP_NOFS);
|
||||
buf->flags |= EXTENT_CSUM;
|
||||
btrfs_set_buffer_defrag(buf);
|
||||
if (!btrfs_test_opt(root, SSD))
|
||||
btrfs_set_buffer_defrag(buf);
|
||||
trans->blocks_used++;
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -179,6 +179,9 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
|
|||
if (root->ref_cows == 0 && !is_extent)
|
||||
goto out;
|
||||
|
||||
if (btrfs_test_opt(root, SSD))
|
||||
goto out;
|
||||
|
||||
path = btrfs_alloc_path();
|
||||
if (!path)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in a new issue