Skip to content

Commit

Permalink
btrfs: let tree defrag work in SSD mode
Browse files Browse the repository at this point in the history
Long time ago (2008) the defrag was automatic for new b-tree writes but
has been disabled after performance problems. There was a leftover in
tree-defrag.c that effectively stops any defragmentation on b-trees.
This is a bit unexpected and IMHO undesired. The SSD mode is an
optimization and defrag is supposed to work if the users asks for it.

Related commits:

6702ed4
Btrfs: Add run time btree defrag, and an ioctl to force btree defrag

e18e480
Btrfs: Add mount -o ssd, which includes optimizations for seek free
storage

b3236e6
Btrfs: Leave on the tree defragger in mount -o ssd, it still helps there

9afbb0b
Btrfs: Disable tree defrag in SSD mode

The last three commits switch the defrag+ssd off/on/off and the last one

3f157a2
Btrfs: Online btree defragmentation fixes

misses the bits from tree-defrag.c to revert to the behaviour introduced
in e18e480.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
David Sterba authored and Chris Mason committed Jun 3, 2015
1 parent 53e489b commit 1302890
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/tree-defrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
goto out;

if (btrfs_test_opt(root, SSD))
goto out;

path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
Expand Down

0 comments on commit 1302890

Please sign in to comment.