aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-kcopyd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
index 996802b8a452..8f153530d6df 100644
--- a/drivers/md/dm-kcopyd.c
+++ b/drivers/md/dm-kcopyd.c
@@ -268,6 +268,17 @@ static void push(struct list_head *jobs, struct kcopyd_job *job)
268 spin_unlock_irqrestore(&kc->job_lock, flags); 268 spin_unlock_irqrestore(&kc->job_lock, flags);
269} 269}
270 270
271
272static void push_head(struct list_head *jobs, struct kcopyd_job *job)
273{
274 unsigned long flags;
275 struct dm_kcopyd_client *kc = job->kc;
276
277 spin_lock_irqsave(&kc->job_lock, flags);
278 list_add(&job->list, jobs);
279 spin_unlock_irqrestore(&kc->job_lock, flags);
280}
281
271/* 282/*
272 * These three functions process 1 item from the corresponding 283 * These three functions process 1 item from the corresponding
273 * job list. 284 * job list.
@@ -398,7 +409,7 @@ static int process_jobs(struct list_head *jobs, struct dm_kcopyd_client *kc,
398 * We couldn't service this job ATM, so 409 * We couldn't service this job ATM, so
399 * push this job back onto the list. 410 * push this job back onto the list.
400 */ 411 */
401 push(jobs, job); 412 push_head(jobs, job);
402 break; 413 break;
403 } 414 }
404 415