Commit 4bb04406 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: Improve code for deciding whether to skip an IO in raid5

Instread of the 'skip' variable, just test if rdev is NULL or not.
parent acd8a264
......@@ -1139,23 +1139,22 @@ static void handle_stripe(struct stripe_head *sh)
for (i=disks; i-- ;)
if (action[i]) {
struct bio *bi = &sh->dev[i].req;
int skip = 0;
mdk_rdev_t *rdev = NULL;
mdk_rdev_t *rdev ;
if (action[i] == READ+1)
bi->bi_end_io = raid5_end_read_request;
else
bi->bi_end_io = raid5_end_write_request;
spin_lock_irq(&conf->device_lock);
if (conf->disks[i].operational)
rdev = conf->disks[i].rdev;
else skip=1;
rdev = conf->disks[i].rdev;
if (!conf->disks[i].operational)
rdev = NULL;
if (rdev)
atomic_inc(&rdev->nr_pending);
else skip=1;
spin_unlock_irq(&conf->device_lock);
if (!skip) {
if (rdev) {
bi->bi_bdev = rdev->bdev;
PRINTK("for %ld schedule op %d on disc %d\n", sh->sector, action[i]-1, i);
atomic_inc(&sh->count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment