]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
dm io: write error bits form long not int
authorAlasdair G Kergon <agk@redhat.com>
Fri, 28 Mar 2008 21:16:10 +0000 (14:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Mar 2008 21:45:23 +0000 (14:45 -0700)
write_err is an unsigned long used with set_bit() so should not be passed
around as unsigned int.

http://bugzilla.kernel.org/show_bug.cgi?id=10271

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/dm-io.c
drivers/md/dm-raid1.c
drivers/md/dm-snap.c
drivers/md/kcopyd.c
drivers/md/kcopyd.h

index b8e342fe75863e526a074584d3e0b64f92b775da..8f25f628ef16d5e680129656d3a1885c115a432d 100644 (file)
@@ -114,7 +114,7 @@ static void dec_count(struct io *io, unsigned int region, int error)
                        wake_up_process(io->sleeper);
 
                else {
-                       int r = io->error;
+                       unsigned long r = io->error;
                        io_notify_fn fn = io->callback;
                        void *context = io->context;
 
index 51605870f898e23dfa450314de6ef2409d4351c0..762cb086bb7f6e864fca4998f407644e8add96cc 100644 (file)
@@ -753,7 +753,7 @@ out:
  * are in the no-sync state.  We have to recover these by
  * recopying from the default mirror to all the others.
  *---------------------------------------------------------------*/
-static void recovery_complete(int read_err, unsigned int write_err,
+static void recovery_complete(int read_err, unsigned long write_err,
                              void *context)
 {
        struct region *reg = (struct region *)context;
@@ -767,7 +767,7 @@ static void recovery_complete(int read_err, unsigned int write_err,
        }
 
        if (write_err) {
-               DMERR_LIMIT("Write error during recovery (error = 0x%x)",
+               DMERR_LIMIT("Write error during recovery (error = 0x%lx)",
                            write_err);
                /*
                 * Bits correspond to devices (excluding default mirror).
index ae24eab8cd811c573b619b4e226244ff372f4119..4dc8a43c034b0242422399a15a7d6a271f97da3d 100644 (file)
@@ -804,7 +804,7 @@ static void commit_callback(void *context, int success)
  * Called when the copy I/O has finished.  kcopyd actually runs
  * this code so don't block.
  */
-static void copy_callback(int read_err, unsigned int write_err, void *context)
+static void copy_callback(int read_err, unsigned long write_err, void *context)
 {
        struct dm_snap_pending_exception *pe = context;
        struct dm_snapshot *s = pe->snap;
index f3831f31223e51ba873d67cc2aca45c786b8001b..e76b52ade69027f467fe3f16cf1b10443f4711bc 100644 (file)
@@ -169,7 +169,7 @@ struct kcopyd_job {
         * Error state of the job.
         */
        int read_err;
-       unsigned int write_err;
+       unsigned long write_err;
 
        /*
         * Either READ or WRITE
@@ -293,7 +293,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 +396,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 +448,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;
index 4621ea055c0ea3aa3dc4381c34cdac7991a99950..4845f2a0c676fdffc9d9bbf88152415484193e1f 100644 (file)
@@ -32,8 +32,8 @@ void kcopyd_client_destroy(struct kcopyd_client *kc);
  * read_err is a boolean,
  * write_err is a bitset, with 1 bit for each destination region
  */
-typedef void (*kcopyd_notify_fn)(int read_err,
-                                unsigned int write_err, void *context);
+typedef void (*kcopyd_notify_fn)(int read_err, unsigned long write_err,
+                                void *context);
 
 int kcopyd_copy(struct kcopyd_client *kc, struct io_region *from,
                unsigned int num_dests, struct io_region *dests,