aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-02-15 13:19:35 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:00 -0400
commit9afbb0b752ef30a429c45b9de6706e28ad1a36e1 (patch)
tree2e1d749ced02b62282fe899237c7595ebb6add63 /fs/btrfs
parentdf68b8a7ad4a18c9e63f1c12015a59c3b7031adb (diff)
Btrfs: Disable tree defrag in SSD mode
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c3
-rw-r--r--fs/btrfs/tree-defrag.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 220e9be9ad82..af5d4a085280 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1835,7 +1835,8 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
1835 buf->start, buf->start + buf->len - 1, 1835 buf->start, buf->start + buf->len - 1,
1836 EXTENT_CSUM, GFP_NOFS); 1836 EXTENT_CSUM, GFP_NOFS);
1837 buf->flags |= EXTENT_CSUM; 1837 buf->flags |= EXTENT_CSUM;
1838 btrfs_set_buffer_defrag(buf); 1838 if (!btrfs_test_opt(root, SSD))
1839 btrfs_set_buffer_defrag(buf);
1839 trans->blocks_used++; 1840 trans->blocks_used++;
1840 return buf; 1841 return buf;
1841} 1842}
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c
index 5c58630dce03..5935cbd8f2b8 100644
--- a/fs/btrfs/tree-defrag.c
+++ b/fs/btrfs/tree-defrag.c
@@ -179,6 +179,9 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
179 if (root->ref_cows == 0 && !is_extent) 179 if (root->ref_cows == 0 && !is_extent)
180 goto out; 180 goto out;
181 181
182 if (btrfs_test_opt(root, SSD))
183 goto out;
184
182 path = btrfs_alloc_path(); 185 path = btrfs_alloc_path();
183 if (!path) 186 if (!path)
184 return -ENOMEM; 187 return -ENOMEM;