linux内核md源代码解读 八 阵列同步二:同步过程
发布时间:2016-09-14 15:21:33 所属栏目:Linux 来源:站长网
导读:在上一小节里讲到启动同步线程: 7824 mddev-sync_thread = md_register_thread(md_do_sync, 7825 mddev, 7826 resync); md_register_thread函数如下: 6697 st
7346 j = 0;
7347 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
7348 /* resync follows the size requested by the personality,
7349 * which defaults to physical size, but can be virtual size
7350 */
7351 max_sectors = mddev->resync_max_sectors;
7352 mddev->resync_mismatches = 0;
7353 /* we don't use the checkpoint if there's a bitmap */
7354 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
7355 j = mddev->resync_min;
7356 else if (!mddev->bitmap)
7357 j = mddev->recovery_cp;
7358
7359 } else if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
7360 max_sectors = mddev->resync_max_sectors;
7361 else {
7362 /* recovery follows the physical size of devices */
7363 max_sectors = mddev->dev_sectors;
7364 j = MaxSector;
7365 rcu_read_lock();
7366 rdev_for_each_rcu(rdev, mddev)
7367 if (rdev->raid_disk >= 0 &&
7368 !test_bit(Faulty, &rdev->flags) &&
7369 !test_bit(In_sync, &rdev->flags) &&
7370 rdev->recovery_offset < j)
7371 j = rdev->recovery_offset;
7372 rcu_read_unlock();
7373 }
7374
7375 printk(KERN_INFO "md: %s of RAID array %sn", desc, mdname(mddev));
7376 printk(KERN_INFO "md: minimum _guaranteed_ speed:"
7377 " %d KB/sec/disk.n", speed_min(mddev));
7378 printk(KERN_INFO "md: using maximum available idle IO bandwidth "
7379 "(but not more than %d KB/sec) for %s.n",
7380 speed_max(mddev), desc);
7381
7382 is_mddev_idle(mddev, 1); /* this initializes IO event counters */
7347行,是同步。 (编辑:温州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐
热点阅读

