Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9afbb0b7 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: Disable tree defrag in SSD mode

parent df68b8a7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1835,6 +1835,7 @@ 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;
	if (!btrfs_test_opt(root, SSD))
		btrfs_set_buffer_defrag(buf);
	trans->blocks_used++;
	return buf;
+3 −0
Original line number Diff line number Diff line
@@ -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;