]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/kcopyd.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[linux-2.6-omap-h63xx.git] / drivers / md / kcopyd.c
index ed71f3f946209e46799618546f1d4f3491753d47..b46f6c575f7ebd5ee79dbe543525ed5459e173d6 100644 (file)
@@ -12,7 +12,6 @@
 #include <asm/atomic.h>
 
 #include <linux/blkdev.h>
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/list.h>
@@ -22,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/workqueue.h>
+#include <linux/mutex.h>
 
 #include "kcopyd.h"
 
@@ -203,7 +203,7 @@ struct kcopyd_job {
 /* FIXME: this should scale with the number of pages */
 #define MIN_JOBS 512
 
-static kmem_cache_t *_job_cache;
+static struct kmem_cache *_job_cache;
 static mempool_t *_job_pool;
 
 /*
@@ -313,7 +313,7 @@ static void complete_io(unsigned long error, void *context)
 
        if (error) {
                if (job->rw == WRITE)
-                       job->write_err &= error;
+                       job->write_err |= error;
                else
                        job->read_err = 1;
 
@@ -417,7 +417,7 @@ static int process_jobs(struct list_head *jobs, int (*fn) (struct kcopyd_job *))
 /*
  * kcopyd does this every time it's woken up.
  */
-static void do_work(void *ignored)
+static void do_work(struct work_struct *ignored)
 {
        /*
         * The order that these are called is *very* important.
@@ -459,7 +459,7 @@ static void segment_complete(int read_err,
                job->read_err = 1;
 
        if (write_err)
-               job->write_err &= write_err;
+               job->write_err |= write_err;
 
        /*
         * Only dispatch more work if there hasn't been an error.
@@ -581,21 +581,21 @@ int kcopyd_cancel(struct kcopyd_job *job, int block)
 /*-----------------------------------------------------------------
  * Unit setup
  *---------------------------------------------------------------*/
-static DECLARE_MUTEX(_client_lock);
+static DEFINE_MUTEX(_client_lock);
 static LIST_HEAD(_clients);
 
 static void client_add(struct kcopyd_client *kc)
 {
-       down(&_client_lock);
+       mutex_lock(&_client_lock);
        list_add(&kc->list, &_clients);
-       up(&_client_lock);
+       mutex_unlock(&_client_lock);
 }
 
 static void client_del(struct kcopyd_client *kc)
 {
-       down(&_client_lock);
+       mutex_lock(&_client_lock);
        list_del(&kc->list);
-       up(&_client_lock);
+       mutex_unlock(&_client_lock);
 }
 
 static DEFINE_MUTEX(kcopyd_init_lock);
@@ -628,7 +628,7 @@ static int kcopyd_init(void)
        }
 
        kcopyd_clients++;
-       INIT_WORK(&_kcopyd_work, do_work, NULL);
+       INIT_WORK(&_kcopyd_work, do_work);
        mutex_unlock(&kcopyd_init_lock);
        return 0;
 }