summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-kcopyd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 09:50:12 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 09:50:12 -0700
commit3e5cce627cfaa35410ab77c50641c52b7096d3b5 (patch)
tree74d039845f6d532a5d7f9623c92469944809a19f /drivers/md/dm-kcopyd.c
parentf2e4bd2b37bf072babc6a1f6c2a7ef53b7b046ad (diff)
parent51157b4ab47e1376c2b93cb854b14b637efeaff2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: dm: tidy local_init dm: remove unused flush_all dm raid1: separate region_hash interface part1 dm: mark split bio as cloned dm crypt: remove waitqueue dm crypt: fix async split dm crypt: tidy sector dm: remove dm header from targets dm: publish array_too_big dm exception store: fix misordered writes dm exception store: refactor zero_area dm snapshot: drop unused last_percent dm snapshot: fix primary_pe race dm kcopyd: avoid queue shuffle
Diffstat (limited to 'drivers/md/dm-kcopyd.c')
-rw-r--r--drivers/md/dm-kcopyd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
index 996802b8a45..3073618269e 100644
--- a/drivers/md/dm-kcopyd.c
+++ b/drivers/md/dm-kcopyd.c
@@ -22,6 +22,7 @@
#include <linux/vmalloc.h>
#include <linux/workqueue.h>
#include <linux/mutex.h>
+#include <linux/device-mapper.h>
#include <linux/dm-kcopyd.h>
#include "dm.h"
@@ -268,6 +269,17 @@ static void push(struct list_head *jobs, struct kcopyd_job *job)
spin_unlock_irqrestore(&kc->job_lock, flags);
}
+
+static void push_head(struct list_head *jobs, struct kcopyd_job *job)
+{
+ unsigned long flags;
+ struct dm_kcopyd_client *kc = job->kc;
+
+ spin_lock_irqsave(&kc->job_lock, flags);
+ list_add(&job->list, jobs);
+ spin_unlock_irqrestore(&kc->job_lock, flags);
+}
+
/*
* These three functions process 1 item from the corresponding
* job list.
@@ -398,7 +410,7 @@ static int process_jobs(struct list_head *jobs, struct dm_kcopyd_client *kc,
* We couldn't service this job ATM, so
* push this job back onto the list.
*/
- push(jobs, job);
+ push_head(jobs, job);
break;
}