dm io: clean interface
[cascardo/linux.git] / drivers / md / kcopyd.c
index f3831f3..21fea42 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mutex.h>
 
 #include "kcopyd.h"
+#include "dm.h"
 
 static struct workqueue_struct *_kcopyd_wq;
 static struct work_struct _kcopyd_work;
@@ -169,19 +170,19 @@ struct kcopyd_job {
         * Error state of the job.
         */
        int read_err;
-       unsigned int write_err;
+       unsigned long write_err;
 
        /*
         * Either READ or WRITE
         */
        int rw;
-       struct io_region source;
+       struct dm_io_region source;
 
        /*
         * The destinations for the transfer.
         */
        unsigned int num_dests;
-       struct io_region dests[KCOPYD_MAX_REGIONS];
+       struct dm_io_region dests[KCOPYD_MAX_REGIONS];
 
        sector_t offset;
        unsigned int nr_pages;
@@ -293,7 +294,7 @@ static int run_complete_job(struct kcopyd_job *job)
 {
        void *context = job->context;
        int read_err = job->read_err;
-       unsigned int write_err = job->write_err;
+       unsigned long write_err = job->write_err;
        kcopyd_notify_fn fn = job->fn;
        struct kcopyd_client *kc = job->kc;
 
@@ -396,7 +397,7 @@ static int process_jobs(struct list_head *jobs, int (*fn) (struct kcopyd_job *))
                if (r < 0) {
                        /* error this rogue job */
                        if (job->rw == WRITE)
-                               job->write_err = (unsigned int) -1;
+                               job->write_err = (unsigned long) -1L;
                        else
                                job->read_err = 1;
                        push(&_complete_jobs, job);
@@ -448,8 +449,8 @@ static void dispatch_job(struct kcopyd_job *job)
 }
 
 #define SUB_JOB_SIZE 128
-static void segment_complete(int read_err,
-                            unsigned int write_err, void *context)
+static void segment_complete(int read_err, unsigned long write_err,
+                            void *context)
 {
        /* FIXME: tidy this function */
        sector_t progress = 0;
@@ -526,8 +527,8 @@ static void split_job(struct kcopyd_job *job)
                segment_complete(0, 0u, job);
 }
 
-int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
-               unsigned int num_dests, struct io_region *dests,
+int kcopyd_copy(struct kcopyd_client *kc, struct dm_io_region *from,
+               unsigned int num_dests, struct dm_io_region *dests,
                unsigned int flags, kcopyd_notify_fn fn, void *context)
 {
        struct kcopyd_job *job;