aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6aa497e4baf8..26ba42a79129 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -262,6 +262,12 @@ static void mddev_resume(mddev_t *mddev)
262 mddev->pers->quiesce(mddev, 0); 262 mddev->pers->quiesce(mddev, 0);
263} 263}
264 264
265int mddev_congested(mddev_t *mddev, int bits)
266{
267 return mddev->suspended;
268}
269EXPORT_SYMBOL(mddev_congested);
270
265 271
266static inline mddev_t *mddev_get(mddev_t *mddev) 272static inline mddev_t *mddev_get(mddev_t *mddev)
267{ 273{
@@ -4218,7 +4224,7 @@ static int do_md_run(mddev_t * mddev)
4218 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); 4224 set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
4219 mddev->sync_thread = md_register_thread(md_do_sync, 4225 mddev->sync_thread = md_register_thread(md_do_sync,
4220 mddev, 4226 mddev,
4221 "%s_resync"); 4227 "resync");
4222 if (!mddev->sync_thread) { 4228 if (!mddev->sync_thread) {
4223 printk(KERN_ERR "%s: could not start resync" 4229 printk(KERN_ERR "%s: could not start resync"
4224 " thread...\n", 4230 " thread...\n",
@@ -4575,10 +4581,10 @@ static int get_version(void __user * arg)
4575static int get_array_info(mddev_t * mddev, void __user * arg) 4581static int get_array_info(mddev_t * mddev, void __user * arg)
4576{ 4582{
4577 mdu_array_info_t info; 4583 mdu_array_info_t info;
4578 int nr,working,active,failed,spare; 4584 int nr,working,insync,failed,spare;
4579 mdk_rdev_t *rdev; 4585 mdk_rdev_t *rdev;
4580 4586
4581 nr=working=active=failed=spare=0; 4587 nr=working=insync=failed=spare=0;
4582 list_for_each_entry(rdev, &mddev->disks, same_set) { 4588 list_for_each_entry(rdev, &mddev->disks, same_set) {
4583 nr++; 4589 nr++;
4584 if (test_bit(Faulty, &rdev->flags)) 4590 if (test_bit(Faulty, &rdev->flags))
@@ -4586,7 +4592,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
4586 else { 4592 else {
4587 working++; 4593 working++;
4588 if (test_bit(In_sync, &rdev->flags)) 4594 if (test_bit(In_sync, &rdev->flags))
4589 active++; 4595 insync++;
4590 else 4596 else
4591 spare++; 4597 spare++;
4592 } 4598 }
@@ -4611,7 +4617,7 @@ static int get_array_info(mddev_t * mddev, void __user * arg)
4611 info.state = (1<<MD_SB_CLEAN); 4617 info.state = (1<<MD_SB_CLEAN);
4612 if (mddev->bitmap && mddev->bitmap_offset) 4618 if (mddev->bitmap && mddev->bitmap_offset)
4613 info.state = (1<<MD_SB_BITMAP_PRESENT); 4619 info.state = (1<<MD_SB_BITMAP_PRESENT);
4614 info.active_disks = active; 4620 info.active_disks = insync;
4615 info.working_disks = working; 4621 info.working_disks = working;
4616 info.failed_disks = failed; 4622 info.failed_disks = failed;
4617 info.spare_disks = spare; 4623 info.spare_disks = spare;
@@ -4721,7 +4727,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
4721 if (!list_empty(&mddev->disks)) { 4727 if (!list_empty(&mddev->disks)) {
4722 mdk_rdev_t *rdev0 = list_entry(mddev->disks.next, 4728 mdk_rdev_t *rdev0 = list_entry(mddev->disks.next,
4723 mdk_rdev_t, same_set); 4729 mdk_rdev_t, same_set);
4724 int err = super_types[mddev->major_version] 4730 err = super_types[mddev->major_version]
4725 .load_super(rdev, rdev0, mddev->minor_version); 4731 .load_super(rdev, rdev0, mddev->minor_version);
4726 if (err < 0) { 4732 if (err < 0) {
4727 printk(KERN_WARNING 4733 printk(KERN_WARNING
@@ -5631,7 +5637,10 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,
5631 thread->run = run; 5637 thread->run = run;
5632 thread->mddev = mddev; 5638 thread->mddev = mddev;
5633 thread->timeout = MAX_SCHEDULE_TIMEOUT; 5639 thread->timeout = MAX_SCHEDULE_TIMEOUT;
5634 thread->tsk = kthread_run(md_thread, thread, name, mdname(thread->mddev)); 5640 thread->tsk = kthread_run(md_thread, thread,
5641 "%s_%s",
5642 mdname(thread->mddev),
5643 name ?: mddev->pers->name);
5635 if (IS_ERR(thread->tsk)) { 5644 if (IS_ERR(thread->tsk)) {
5636 kfree(thread); 5645 kfree(thread);
5637 return NULL; 5646 return NULL;
@@ -6745,7 +6754,7 @@ void md_check_recovery(mddev_t *mddev)
6745 } 6754 }
6746 mddev->sync_thread = md_register_thread(md_do_sync, 6755 mddev->sync_thread = md_register_thread(md_do_sync,
6747 mddev, 6756 mddev,
6748 "%s_resync"); 6757 "resync");
6749 if (!mddev->sync_thread) { 6758 if (!mddev->sync_thread) {
6750 printk(KERN_ERR "%s: could not start resync" 6759 printk(KERN_ERR "%s: could not start resync"
6751 " thread...\n", 6760 " thread...\n",