Lines Matching refs:disk

330  * Update disk head position estimator based on IRQ completion info.
332 static inline void update_head_pos(int disk, struct r1bio *r1_bio)
336 conf->mirrors[disk].head_position =
341 * Find the disk number which triggered given bio
581 * This routine returns the disk from which the requested read should
583 * number - if this matches on the next IO then we use the last disk.
584 * There is also a per-disk 'last know head position' sector that is
587 * perfect sequential match then we pick the disk whose head is closest.
601 int disk;
612 * We take the first readable disk when above the resync window.
634 for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) {
641 rdev = rcu_dereference(conf->mirrors[disk].rdev);
642 if (r1_bio->bios[disk] == IO_BLOCKED
661 best_dist_disk = disk;
662 best_pending_disk = disk;
689 best_disk = disk;
708 dist = abs(this_sector - conf->mirrors[disk].head_position);
710 best_disk = disk;
713 /* Don't change to another disk for sequential reads */
714 if (conf->mirrors[disk].next_seq_sect == this_sector
717 struct raid1_info *mirror = &conf->mirrors[disk];
719 best_disk = disk;
722 * iosize, check if there is idle disk. If yes, choose
723 * the idle disk. read_balance could already choose an
724 * idle disk before noticing it's a sequential IO in
725 * this disk. This doesn't matter because this disk
727 * first disk has IO size exceeds optimal iosize. In
728 * this way, iosize of the first disk will be optimal
729 * iosize at least. iosize of the second disk might be
730 * small, but not a big deal since when the second disk
731 * starts IO, the first disk is likely still busy.
749 best_pending_disk = disk;
754 best_dist_disk = disk;
759 * If all disks are rotational, choose the closest disk. If any disk is
760 * non-rotational, choose the disk with less pending request even the
761 * disk is rotational, which might/might not be optimal for raids with
791 /* flush any pending bitmap writes to disk before proceeding w/ I/O */
1060 * 1) management command handlers (reshape, remove disk, quiesce).
1416 * only applies if the disk is
1653 pr_debug(" disk %d, wo:%d, o:%d, dev:%s\n",
1744 * find the disk ... but prefer rdev->saved_raid_disk
2624 int disk = -1;
2750 if (disk < 0)
2751 disk = i;
2779 if (disk < 0)
2780 disk = wonly;
2781 r1_bio->read_disk = disk;
2928 struct raid1_info *disk;
2989 disk = conf->mirrors + mddev->raid_disks + disk_idx;
2991 disk = conf->mirrors + disk_idx;
2993 if (disk->rdev)
2995 disk->rdev = rdev;
2996 disk->head_position = 0;
2997 disk->seq_start = MaxSector;
3014 disk = conf->mirrors + i;
3017 disk[conf->raid_disks].rdev) {
3019 if (!disk->rdev) {
3023 disk->rdev =
3024 disk[conf->raid_disks].rdev;
3025 disk[conf->raid_disks].rdev = NULL;
3026 } else if (!test_bit(In_sync, &disk->rdev->flags))
3031 if (!disk->rdev ||
3032 !test_bit(In_sync, &disk->rdev->flags)) {
3033 disk->head_position = 0;
3034 if (disk->rdev &&
3035 (disk->rdev->saved_raid_disk < 0))
3118 * RAID1 needs at least one disk in active