Lines Matching refs:mddev
54 struct mddev *mddev = mp_bh->mddev; in multipath_reschedule_retry() local
55 struct mpconf *conf = mddev->private; in multipath_reschedule_retry()
60 md_wakeup_thread(mddev->thread); in multipath_reschedule_retry()
71 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_bh_io()
81 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_request()
90 md_error (mp_bh->mddev, rdev); in multipath_end_request()
97 rdev_dec_pending(rdev, conf->mddev); in multipath_end_request()
100 static bool multipath_make_request(struct mddev *mddev, struct bio * bio) in multipath_make_request() argument
102 struct mpconf *conf = mddev->private; in multipath_make_request()
107 && md_flush_request(mddev, bio)) in multipath_make_request()
113 mp_bh->mddev = mddev; in multipath_make_request()
129 mddev_check_write_zeroes(mddev, &mp_bh->bio); in multipath_make_request()
134 static void multipath_status(struct seq_file *seq, struct mddev *mddev) in multipath_status() argument
136 struct mpconf *conf = mddev->private; in multipath_status()
140 conf->raid_disks - mddev->degraded); in multipath_status()
153 static void multipath_error (struct mddev *mddev, struct md_rdev *rdev) in multipath_error() argument
155 struct mpconf *conf = mddev->private; in multipath_error()
157 if (conf->raid_disks - mddev->degraded <= 1) { in multipath_error()
173 mddev->degraded++; in multipath_error()
177 set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags); in multipath_error()
181 conf->raid_disks - mddev->degraded); in multipath_error()
194 pr_debug(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded, in print_multipath_conf()
206 static int multipath_add_disk(struct mddev *mddev, struct md_rdev *rdev) in multipath_add_disk() argument
208 struct mpconf *conf = mddev->private; in multipath_add_disk()
213 int last = mddev->raid_disks - 1; in multipath_add_disk()
222 disk_stack_limits(mddev->gendisk, rdev->bdev, in multipath_add_disk()
225 err = md_integrity_add_rdev(rdev, mddev); in multipath_add_disk()
229 mddev->degraded--; in multipath_add_disk()
243 static int multipath_remove_disk(struct mddev *mddev, struct md_rdev *rdev) in multipath_remove_disk() argument
245 struct mpconf *conf = mddev->private; in multipath_remove_disk()
269 err = md_integrity_register(mddev); in multipath_remove_disk()
287 struct mddev *mddev = thread->mddev; in multipathd() local
291 struct mpconf *conf = mddev->private; in multipathd()
294 md_check_recovery(mddev); in multipathd()
328 static sector_t multipath_size(struct mddev *mddev, sector_t sectors, int raid_disks) in multipath_size() argument
333 return mddev->dev_sectors; in multipath_size()
336 static int multipath_run (struct mddev *mddev) in multipath_run() argument
345 if (md_check_no_bitmap(mddev)) in multipath_run()
348 if (mddev->level != LEVEL_MULTIPATH) { in multipath_run()
350 mdname(mddev), mddev->level); in multipath_run()
360 mddev->private = conf; in multipath_run()
364 conf->multipaths = kcalloc(mddev->raid_disks, in multipath_run()
371 rdev_for_each(rdev, mddev) { in multipath_run()
374 disk_idx >= mddev->raid_disks) in multipath_run()
379 disk_stack_limits(mddev->gendisk, rdev->bdev, in multipath_run()
386 conf->raid_disks = mddev->raid_disks; in multipath_run()
387 conf->mddev = mddev; in multipath_run()
393 mdname(mddev)); in multipath_run()
396 mddev->degraded = conf->raid_disks - working_disks; in multipath_run()
403 mddev->thread = md_register_thread(multipathd, mddev, in multipath_run()
405 if (!mddev->thread) in multipath_run()
409 mdname(mddev), conf->raid_disks - mddev->degraded, in multipath_run()
410 mddev->raid_disks); in multipath_run()
414 md_set_array_sectors(mddev, multipath_size(mddev, 0, 0)); in multipath_run()
416 if (md_integrity_register(mddev)) in multipath_run()
425 mddev->private = NULL; in multipath_run()
430 static void multipath_free(struct mddev *mddev, void *priv) in multipath_free() argument