summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>2014-06-24 17:00:44 +0200
committerChris Mason <clm@fb.com>2014-06-28 22:48:46 +0200
commitc39aa7056f50fa7b49265ea35c0f3eddb7c7be68 (patch)
tree4cd62c181256ed48e5a733978f08fb547970352d /fs
parentBtrfs: fix crash when mounting raid5 btrfs with missing disks (diff)
downloadlinux-c39aa7056f50fa7b49265ea35c0f3eddb7c7be68.tar.xz
linux-c39aa7056f50fa7b49265ea35c0f3eddb7c7be68.zip
btrfs compression: reuse recently used workspace
Add compression `workspace' in free_workspace() to `idle_workspace' list head, instead of tail. So we have better chances to reuse most recently used `workspace'. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/compression.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 92371c414228..1daea0b47187 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -821,7 +821,7 @@ static void free_workspace(int type, struct list_head *workspace)
spin_lock(workspace_lock);
if (*num_workspace < num_online_cpus()) {
- list_add_tail(workspace, idle_workspace);
+ list_add(workspace, idle_workspace);
(*num_workspace)++;
spin_unlock(workspace_lock);
goto wake;