aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2008-06-27 18:31:55 -0400
committerNeil Brown <neilb@notabene.brown>2008-06-27 18:31:55 -0400
commitf0e43bcdebf709d747a3effb210aff1941e819ab (patch)
tree3d95952224a1e31a49f9e635470aad3cdf6a707a /drivers/md/raid5.c
parentc4e5ac0a22e664eecf29249553cf16c2433f5f25 (diff)
md: unify raid5/6 i/o submission
From: Dan Williams <dan.j.williams@intel.com> Let the raid6 path call ops_run_io to get pending i/o submitted. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c63
1 files changed, 2 insertions, 61 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index c4ef3071c290..6f3dd12dd3a4 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3114,68 +3114,9 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
3114 if (unlikely(blocked_rdev)) 3114 if (unlikely(blocked_rdev))
3115 md_wait_for_blocked_rdev(blocked_rdev, conf->mddev); 3115 md_wait_for_blocked_rdev(blocked_rdev, conf->mddev);
3116 3116
3117 return_io(return_bi); 3117 ops_run_io(sh, &s);
3118
3119 for (i=disks; i-- ;) {
3120 int rw;
3121 struct bio *bi;
3122 mdk_rdev_t *rdev;
3123 if (test_and_clear_bit(R5_Wantwrite, &sh->dev[i].flags))
3124 rw = WRITE;
3125 else if (test_and_clear_bit(R5_Wantread, &sh->dev[i].flags))
3126 rw = READ;
3127 else
3128 continue;
3129
3130 set_bit(STRIPE_IO_STARTED, &sh->state);
3131
3132 bi = &sh->dev[i].req;
3133
3134 bi->bi_rw = rw;
3135 if (rw == WRITE)
3136 bi->bi_end_io = raid5_end_write_request;
3137 else
3138 bi->bi_end_io = raid5_end_read_request;
3139
3140 rcu_read_lock();
3141 rdev = rcu_dereference(conf->disks[i].rdev);
3142 if (rdev && test_bit(Faulty, &rdev->flags))
3143 rdev = NULL;
3144 if (rdev)
3145 atomic_inc(&rdev->nr_pending);
3146 rcu_read_unlock();
3147
3148 if (rdev) {
3149 if (s.syncing || s.expanding || s.expanded)
3150 md_sync_acct(rdev->bdev, STRIPE_SECTORS);
3151 3118
3152 bi->bi_bdev = rdev->bdev; 3119 return_io(return_bi);
3153 pr_debug("for %llu schedule op %ld on disc %d\n",
3154 (unsigned long long)sh->sector, bi->bi_rw, i);
3155 atomic_inc(&sh->count);
3156 bi->bi_sector = sh->sector + rdev->data_offset;
3157 bi->bi_flags = 1 << BIO_UPTODATE;
3158 bi->bi_vcnt = 1;
3159 bi->bi_max_vecs = 1;
3160 bi->bi_idx = 0;
3161 bi->bi_io_vec = &sh->dev[i].vec;
3162 bi->bi_io_vec[0].bv_len = STRIPE_SIZE;
3163 bi->bi_io_vec[0].bv_offset = 0;
3164 bi->bi_size = STRIPE_SIZE;
3165 bi->bi_next = NULL;
3166 if (rw == WRITE &&
3167 test_bit(R5_ReWrite, &sh->dev[i].flags))
3168 atomic_add(STRIPE_SECTORS, &rdev->corrected_errors);
3169 generic_make_request(bi);
3170 } else {
3171 if (rw == WRITE)
3172 set_bit(STRIPE_DEGRADED, &sh->state);
3173 pr_debug("skip op %ld on disc %d for sector %llu\n",
3174 bi->bi_rw, i, (unsigned long long)sh->sector);
3175 clear_bit(R5_LOCKED, &sh->dev[i].flags);
3176 set_bit(STRIPE_HANDLE, &sh->state);
3177 }
3178 }
3179} 3120}
3180 3121
3181static void handle_stripe(struct stripe_head *sh, struct page *tmp_page) 3122static void handle_stripe(struct stripe_head *sh, struct page *tmp_page)