From 557c2d8d06101b3e3f1135f6ac4113e4c3870154 Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Wed, 14 Oct 2009 09:38:28 -0400 Subject: [PATCH] --- yaml --- r: 167592 b: refs/heads/master c: 444528b3e614f7f2391488d9bca8e0b872db909b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/extent-tree.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e805de5bc1a6..207708da2eb1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0634857488ec6e28fa22920cd0bee3c2ac07ccfd +refs/heads/master: 444528b3e614f7f2391488d9bca8e0b872db909b diff --git a/trunk/fs/btrfs/extent-tree.c b/trunk/fs/btrfs/extent-tree.c index d4a35283d99e..c56f91639dc1 100644 --- a/trunk/fs/btrfs/extent-tree.c +++ b/trunk/fs/btrfs/extent-tree.c @@ -3686,6 +3686,14 @@ static int pin_down_bytes(struct btrfs_trans_handle *trans, if (is_data) goto pinit; + /* + * discard is sloooow, and so triggering discards on + * individual btree blocks isn't a good plan. Just + * pin everything in discard mode. + */ + if (btrfs_test_opt(root, DISCARD)) + goto pinit; + buf = btrfs_find_tree_block(root, bytenr, num_bytes); if (!buf) goto pinit;