block: remove support for bio remapping from ->make_request
[linux-block.git] / drivers / md / md.c
index a6b6471da2bc284c7ada14cd586eb98576ccdfc1..5c2178562c964c17d8fa941f81cde5dd21ec9a00 100644 (file)
@@ -330,18 +330,17 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
  * call has finished, the bio has been linked into some internal structure
  * and so is visible to ->quiesce(), so we don't need the refcount any more.
  */
-static int md_make_request(struct request_queue *q, struct bio *bio)
+static void md_make_request(struct request_queue *q, struct bio *bio)
 {
        const int rw = bio_data_dir(bio);
        mddev_t *mddev = q->queuedata;
-       int rv;
        int cpu;
        unsigned int sectors;
 
        if (mddev == NULL || mddev->pers == NULL
            || !mddev->ready) {
                bio_io_error(bio);
-               return 0;
+               return;
        }
        smp_rmb(); /* Ensure implications of  'active' are visible */
        rcu_read_lock();
@@ -366,7 +365,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
         * go away inside make_request
         */
        sectors = bio_sectors(bio);
-       rv = mddev->pers->make_request(mddev, bio);
+       mddev->pers->make_request(mddev, bio);
 
        cpu = part_stat_lock();
        part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
@@ -375,8 +374,6 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
 
        if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended)
                wake_up(&mddev->sb_wait);
-
-       return rv;
 }
 
 /* mddev_suspend makes sure no new requests are submitted
@@ -475,8 +472,7 @@ static void md_submit_flush_data(struct work_struct *ws)
                bio_endio(bio, 0);
        else {
                bio->bi_rw &= ~REQ_FLUSH;
-               if (mddev->pers->make_request(mddev, bio))
-                       generic_make_request(bio);
+               mddev->pers->make_request(mddev, bio);
        }
 
        mddev->flush_bio = NULL;
@@ -6616,16 +6612,11 @@ static void md_seq_stop(struct seq_file *seq, void *v)
                mddev_put(mddev);
 }
 
-struct mdstat_info {
-       int event;
-};
-
 static int md_seq_show(struct seq_file *seq, void *v)
 {
        mddev_t *mddev = v;
        sector_t sectors;
        mdk_rdev_t *rdev;
-       struct mdstat_info *mi = seq->private;
        struct bitmap *bitmap;
 
        if (v == (void*)1) {
@@ -6637,7 +6628,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
 
                spin_unlock(&pers_lock);
                seq_printf(seq, "\n");
-               mi->event = atomic_read(&md_event_count);
+               seq->poll_event = atomic_read(&md_event_count);
                return 0;
        }
        if (v == (void*)2) {
@@ -6749,26 +6740,21 @@ static const struct seq_operations md_seq_ops = {
 
 static int md_seq_open(struct inode *inode, struct file *file)
 {
+       struct seq_file *seq;
        int error;
-       struct mdstat_info *mi = kmalloc(sizeof(*mi), GFP_KERNEL);
-       if (mi == NULL)
-               return -ENOMEM;
 
        error = seq_open(file, &md_seq_ops);
        if (error)
-               kfree(mi);
-       else {
-               struct seq_file *p = file->private_data;
-               p->private = mi;
-               mi->event = atomic_read(&md_event_count);
-       }
+               return error;
+
+       seq = file->private_data;
+       seq->poll_event = atomic_read(&md_event_count);
        return error;
 }
 
 static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
 {
-       struct seq_file *m = filp->private_data;
-       struct mdstat_info *mi = m->private;
+       struct seq_file *seq = filp->private_data;
        int mask;
 
        poll_wait(filp, &md_event_waiters, wait);
@@ -6776,7 +6762,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
        /* always allow read */
        mask = POLLIN | POLLRDNORM;
 
-       if (mi->event != atomic_read(&md_event_count))
+       if (seq->poll_event != atomic_read(&md_event_count))
                mask |= POLLERR | POLLPRI;
        return mask;
 }
@@ -7165,11 +7151,14 @@ void md_do_sync(mddev_t *mddev)
                        atomic_add(sectors, &mddev->recovery_active);
                }
 
+               if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
+                       break;
+
                j += sectors;
                if (j>1) mddev->curr_resync = j;
                mddev->curr_mark_cnt = io_sectors;
                if (last_check == 0)
-                       /* this is the earliers that rebuilt will be
+                       /* this is the earliest that rebuild will be
                         * visible in /proc/mdstat
                         */
                        md_new_event(mddev);
@@ -7178,10 +7167,6 @@ void md_do_sync(mddev_t *mddev)
                        continue;
 
                last_check = io_sectors;
-
-               if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
-                       break;
-
        repeat:
                if (time_after_eq(jiffies, mark[last_mark] + SYNC_MARK_STEP )) {
                        /* step marks */