Commit 5fc1d9f6 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (15/15) big struct block_device * push (first series)

 - switch md_error() to struct block_device * - just cleaning up
   after ->bi_dev switch.
parent ea394494
...@@ -2556,9 +2556,14 @@ static int unprotect_array(mddev_t * mddev) ...@@ -2556,9 +2556,14 @@ static int unprotect_array(mddev_t * mddev)
static int set_disk_faulty(mddev_t *mddev, kdev_t dev) static int set_disk_faulty(mddev_t *mddev, kdev_t dev)
{ {
mdk_rdev_t *rdev;
int ret; int ret;
ret = md_error(mddev, dev); rdev = find_rdev(mddev, dev);
if (!rdev)
return 0;
ret = md_error(mddev, rdev->bdev);
return ret; return ret;
} }
...@@ -3035,9 +3040,10 @@ void md_recover_arrays(void) ...@@ -3035,9 +3040,10 @@ void md_recover_arrays(void)
} }
int md_error(mddev_t *mddev, kdev_t rdev) int md_error(mddev_t *mddev, struct block_device *bdev)
{ {
mdk_rdev_t * rrdev; mdk_rdev_t * rrdev;
kdev_t rdev = to_kdev_t(bdev->bd_dev);
dprintk("md_error dev:(%d:%d), rdev:(%d:%d), (caller: %p,%p,%p,%p).\n", dprintk("md_error dev:(%d:%d), rdev:(%d:%d), (caller: %p,%p,%p,%p).\n",
major(dev),minor(dev),major(rdev),minor(rdev), major(dev),minor(dev),major(rdev),minor(rdev),
......
...@@ -198,7 +198,7 @@ void multipath_end_request(struct bio *bio) ...@@ -198,7 +198,7 @@ void multipath_end_request(struct bio *bio)
* this branch is our 'one multipath IO has finished' event handler: * this branch is our 'one multipath IO has finished' event handler:
*/ */
if (!uptodate) if (!uptodate)
md_error (mp_bh->mddev, to_kdev_t(bio->bi_bdev->bd_dev)); md_error (mp_bh->mddev, bio->bi_bdev);
else else
/* /*
* Set MPBH_Uptodate in our master buffer_head, so that * Set MPBH_Uptodate in our master buffer_head, so that
......
...@@ -255,7 +255,7 @@ static void end_request(struct bio *bio) ...@@ -255,7 +255,7 @@ static void end_request(struct bio *bio)
* this branch is our 'one mirror IO has finished' event handler: * this branch is our 'one mirror IO has finished' event handler:
*/ */
if (!uptodate) if (!uptodate)
md_error(r1_bio->mddev, to_kdev_t(bio->bi_bdev->bd_dev)); md_error(r1_bio->mddev, bio->bi_bdev);
else else
/* /*
* Set R1BIO_Uptodate in our master bio, so that * Set R1BIO_Uptodate in our master bio, so that
...@@ -947,7 +947,7 @@ static void end_sync_read(struct bio *bio) ...@@ -947,7 +947,7 @@ static void end_sync_read(struct bio *bio)
* We don't do much here, just schedule handling by raid1d * We don't do much here, just schedule handling by raid1d
*/ */
if (!uptodate) if (!uptodate)
md_error (r1_bio->mddev, to_kdev_t(bio->bi_bdev->bd_dev)); md_error (r1_bio->mddev, bio->bi_bdev);
else else
set_bit(R1BIO_Uptodate, &r1_bio->state); set_bit(R1BIO_Uptodate, &r1_bio->state);
reschedule_retry(r1_bio); reschedule_retry(r1_bio);
...@@ -961,7 +961,7 @@ static void end_sync_write(struct bio *bio) ...@@ -961,7 +961,7 @@ static void end_sync_write(struct bio *bio)
int i; int i;
if (!uptodate) if (!uptodate)
md_error(mddev, to_kdev_t(bio->bi_bdev->bd_dev)); md_error(mddev, bio->bi_bdev);
for (i = 0; i < MD_SB_DISKS; i++) for (i = 0; i < MD_SB_DISKS; i++)
if (r1_bio->write_bios[i] == bio) { if (r1_bio->write_bios[i] == bio) {
......
...@@ -418,7 +418,7 @@ static void raid5_end_read_request (struct buffer_head * bh, int uptodate) ...@@ -418,7 +418,7 @@ static void raid5_end_read_request (struct buffer_head * bh, int uptodate)
buffer->b_end_io(buffer, 1); buffer->b_end_io(buffer, 1);
} }
} else { } else {
md_error(conf->mddev, bh->b_dev); md_error(conf->mddev, bh->b_bdev);
clear_bit(BH_Uptodate, &bh->b_state); clear_bit(BH_Uptodate, &bh->b_state);
} }
/* must restore b_page before unlocking buffer... */ /* must restore b_page before unlocking buffer... */
...@@ -452,7 +452,7 @@ static void raid5_end_write_request (struct buffer_head *bh, int uptodate) ...@@ -452,7 +452,7 @@ static void raid5_end_write_request (struct buffer_head *bh, int uptodate)
md_spin_lock_irqsave(&conf->device_lock, flags); md_spin_lock_irqsave(&conf->device_lock, flags);
if (!uptodate) if (!uptodate)
md_error(conf->mddev, bh->b_dev); md_error(conf->mddev, bh->b_bdev);
clear_bit(BH_Lock, &bh->b_state); clear_bit(BH_Lock, &bh->b_state);
set_bit(STRIPE_HANDLE, &sh->state); set_bit(STRIPE_HANDLE, &sh->state);
__release_stripe(conf, sh); __release_stripe(conf, sh);
......
...@@ -86,7 +86,7 @@ extern void md_recover_arrays (void); ...@@ -86,7 +86,7 @@ extern void md_recover_arrays (void);
extern int md_check_ordering (mddev_t *mddev); extern int md_check_ordering (mddev_t *mddev);
extern int md_notify_reboot(struct notifier_block *this, extern int md_notify_reboot(struct notifier_block *this,
unsigned long code, void *x); unsigned long code, void *x);
extern int md_error (mddev_t *mddev, kdev_t rdev); extern int md_error (mddev_t *mddev, struct block_device *bdev);
extern int md_run_setup(void); extern int md_run_setup(void);
extern void md_print_devices (void); extern void md_print_devices (void);
......
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