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) ...@@ -1139,23 +1139,22 @@ static void handle_stripe(struct stripe_head *sh)
for (i=disks; i-- ;) for (i=disks; i-- ;)
if (action[i]) { if (action[i]) {
struct bio *bi = &sh->dev[i].req; struct bio *bi = &sh->dev[i].req;
int skip = 0; mdk_rdev_t *rdev ;
mdk_rdev_t *rdev = NULL;
if (action[i] == READ+1) if (action[i] == READ+1)
bi->bi_end_io = raid5_end_read_request; bi->bi_end_io = raid5_end_read_request;
else else
bi->bi_end_io = raid5_end_write_request; bi->bi_end_io = raid5_end_write_request;
spin_lock_irq(&conf->device_lock); spin_lock_irq(&conf->device_lock);
if (conf->disks[i].operational) rdev = conf->disks[i].rdev;
rdev = conf->disks[i].rdev; if (!conf->disks[i].operational)
else skip=1; rdev = NULL;
if (rdev) if (rdev)
atomic_inc(&rdev->nr_pending); atomic_inc(&rdev->nr_pending);
else skip=1;
spin_unlock_irq(&conf->device_lock); spin_unlock_irq(&conf->device_lock);
if (!skip) { if (rdev) {
bi->bi_bdev = rdev->bdev; bi->bi_bdev = rdev->bdev;
PRINTK("for %ld schedule op %d on disc %d\n", sh->sector, action[i]-1, i); PRINTK("for %ld schedule op %d on disc %d\n", sh->sector, action[i]-1, i);
atomic_inc(&sh->count); 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