diff options
Diffstat (limited to 'fs/btrfs/async-thread.c')
| -rw-r--r-- | fs/btrfs/async-thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 958cd8b5f0d..2ee30174019 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c | |||
| @@ -48,6 +48,7 @@ struct btrfs_worker_thread { | |||
| 48 | 48 | ||
| 49 | /* number of things on the pending list */ | 49 | /* number of things on the pending list */ |
| 50 | atomic_t num_pending; | 50 | atomic_t num_pending; |
| 51 | |||
| 51 | unsigned long sequence; | 52 | unsigned long sequence; |
| 52 | 53 | ||
| 53 | /* protects the pending list. */ | 54 | /* protects the pending list. */ |
| @@ -242,7 +243,7 @@ static struct btrfs_worker_thread *next_worker(struct btrfs_workers *workers) | |||
| 242 | worker = list_entry(next, struct btrfs_worker_thread, worker_list); | 243 | worker = list_entry(next, struct btrfs_worker_thread, worker_list); |
| 243 | atomic_inc(&worker->num_pending); | 244 | atomic_inc(&worker->num_pending); |
| 244 | worker->sequence++; | 245 | worker->sequence++; |
| 245 | if (worker->sequence % 4 == 0) | 246 | if (worker->sequence % workers->idle_thresh == 0) |
| 246 | list_move_tail(next, &workers->worker_list); | 247 | list_move_tail(next, &workers->worker_list); |
| 247 | return worker; | 248 | return worker; |
| 248 | } | 249 | } |
