aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 4aedbff36b8f..bf7782fc5939 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1584,6 +1584,9 @@ static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr,
1584 u64 map_length = num_bytes; 1584 u64 map_length = num_bytes;
1585 struct btrfs_multi_bio *multi = NULL; 1585 struct btrfs_multi_bio *multi = NULL;
1586 1586
1587 if (!btrfs_test_opt(root, DISCARD))
1588 return 0;
1589
1587 /* Tell the block device(s) that the sectors can be discarded */ 1590 /* Tell the block device(s) that the sectors can be discarded */
1588 ret = btrfs_map_block(&root->fs_info->mapping_tree, READ, 1591 ret = btrfs_map_block(&root->fs_info->mapping_tree, READ,
1589 bytenr, &map_length, &multi, 0); 1592 bytenr, &map_length, &multi, 0);