]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-kcopyd.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6-omap-h63xx.git] / drivers / md / dm-kcopyd.c
index 996802b8a4522e50126365d070f21458f9b68be2..3073618269ea3030e468541ea2af6f05dd2aac65 100644 (file)
@@ -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;
                }