Lines Matching refs:disk

335  * Update disk head position estimator based on IRQ completion info.
337 static inline void update_head_pos(int disk, struct r1bio *r1_bio)
341 conf->mirrors[disk].head_position =
346 * Find the disk number which triggered given bio
585 * This routine returns the disk from which the requested read should
587 * number - if this matches on the next IO then we use the last disk.
588 * There is also a per-disk 'last know head position' sector that is
591 * perfect sequential match then we pick the disk whose head is closest.
605 int disk;
616 * We take the first readable disk when above the resync window.
638 for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) {
645 rdev = rcu_dereference(conf->mirrors[disk].rdev);
646 if (r1_bio->bios[disk] == IO_BLOCKED
665 best_dist_disk = disk;
666 best_pending_disk = disk;
693 best_disk = disk;
712 dist = abs(this_sector - conf->mirrors[disk].head_position);
714 best_disk = disk;
717 /* Don't change to another disk for sequential reads */
718 if (conf->mirrors[disk].next_seq_sect == this_sector
721 struct raid1_info *mirror = &conf->mirrors[disk];
723 best_disk = disk;
726 * iosize, check if there is idle disk. If yes, choose
727 * the idle disk. read_balance could already choose an
728 * idle disk before noticing it's a sequential IO in
729 * this disk. This doesn't matter because this disk
731 * first disk has IO size exceeds optimal iosize. In
732 * this way, iosize of the first disk will be optimal
733 * iosize at least. iosize of the second disk might be
734 * small, but not a big deal since when the second disk
735 * starts IO, the first disk is likely still busy.
753 best_pending_disk = disk;
758 best_dist_disk = disk;
763 * If all disks are rotational, choose the closest disk. If any disk is
764 * non-rotational, choose the disk with less pending request even the
765 * disk is rotational, which might/might not be optimal for raids with
801 /* flush any pending bitmap writes to disk before proceeding w/ I/O */
1080 * 1) management command handlers (reshape, remove disk, quiesce).
1448 * only applies if the disk is
1697 pr_debug(" disk %d, wo:%d, o:%d, dev:%pg\n",
1788 * find the disk ... but prefer rdev->saved_raid_disk
2668 int disk = -1;
2794 if (disk < 0)
2795 disk = i;
2823 if (disk < 0)
2824 disk = wonly;
2825 r1_bio->read_disk = disk;
2972 struct raid1_info *disk;
3033 disk = conf->mirrors + mddev->raid_disks + disk_idx;
3035 disk = conf->mirrors + disk_idx;
3037 if (disk->rdev)
3039 disk->rdev = rdev;
3040 disk->head_position = 0;
3041 disk->seq_start = MaxSector;
3057 disk = conf->mirrors + i;
3060 disk[conf->raid_disks].rdev) {
3062 if (!disk->rdev) {
3066 disk->rdev =
3067 disk[conf->raid_disks].rdev;
3068 disk[conf->raid_disks].rdev = NULL;
3069 } else if (!test_bit(In_sync, &disk->rdev->flags))
3074 if (!disk->rdev ||
3075 !test_bit(In_sync, &disk->rdev->flags)) {
3076 disk->head_position = 0;
3077 if (disk->rdev &&
3078 (disk->rdev->saved_raid_disk < 0))
3157 * RAID1 needs at least one disk in active