日期:2014-05-16 浏览次数:20651 次
5171 md_wakeup_thread(mddev->thread);
4823 static void raid5d(struct md_thread *thread) 4824 { 4825 struct mddev *mddev = thread->mddev; 4826 struct r5conf *conf = mddev->private; 4827 int handled; 4828 struct blk_plug plug; 4829 4830 pr_debug("+++ raid5d active\n"); 4831 4832 md_check_recovery(mddev);
7672 /* 7673 * This routine is regularly called by all per-raid-array threads to 7674 * deal with generic issues like resync and super-block update. 7675 * Raid personalities that don't have a thread (linear/raid0) do not 7676 * need this as they never do any recovery or update the superblock. 7677 * 7678 * It does not do any resync itself, but rather "forks" off other threads 7679 * to do that as needed. 7680 * When it is determined that resync is needed, we set MD_RECOVERY_RUNNING in 7681 * "->recovery" and create a thread at ->sync_thread. 7682 * When the thread finishes it sets MD_RECOVERY_DONE 7683 * and wakeups up this thread which will reap the thread and finish up. 7684 * This thread also removes any faulty devices (with nr_pending == 0). 7685 * 7686 * The overall approach is: 7687 * 1/ if the superblock needs updating, update it. 7688 * 2/ If a recovery thread is running, don't do anything else. 7689 * 3/ If recovery has finished, clean up, possibly marking spares active. 7690 * 4/ If there are any faulty devices, remove them. 7691 * 5/ If array is degraded, try to add spares devices 7692 * 6/ If array has spares or is not in-sync, start a resync thread. 7693 */