Lines Matching refs:mp_bh
51 static void multipath_reschedule_retry (struct multipath_bh *mp_bh) in multipath_reschedule_retry() argument
54 struct mddev *mddev = mp_bh->mddev; in multipath_reschedule_retry()
58 list_add(&mp_bh->retry_list, &conf->retry_list); in multipath_reschedule_retry()
68 static void multipath_end_bh_io(struct multipath_bh *mp_bh, blk_status_t status) in multipath_end_bh_io() argument
70 struct bio *bio = mp_bh->master_bio; in multipath_end_bh_io()
71 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_bh_io()
75 mempool_free(mp_bh, &conf->pool); in multipath_end_bh_io()
80 struct multipath_bh *mp_bh = bio->bi_private; in multipath_end_request() local
81 struct mpconf *conf = mp_bh->mddev->private; in multipath_end_request()
82 struct md_rdev *rdev = conf->multipaths[mp_bh->path].rdev; in multipath_end_request()
85 multipath_end_bh_io(mp_bh, 0); in multipath_end_request()
90 md_error (mp_bh->mddev, rdev); in multipath_end_request()
94 multipath_reschedule_retry(mp_bh); in multipath_end_request()
96 multipath_end_bh_io(mp_bh, bio->bi_status); in multipath_end_request()
103 struct multipath_bh * mp_bh; in multipath_make_request() local
111 mp_bh = mempool_alloc(&conf->pool, GFP_NOIO); in multipath_make_request()
113 mp_bh->master_bio = bio; in multipath_make_request()
114 mp_bh->mddev = mddev; in multipath_make_request()
116 mp_bh->path = multipath_map(conf); in multipath_make_request()
117 if (mp_bh->path < 0) { in multipath_make_request()
119 mempool_free(mp_bh, &conf->pool); in multipath_make_request()
122 multipath = conf->multipaths + mp_bh->path; in multipath_make_request()
124 bio_init_clone(multipath->rdev->bdev, &mp_bh->bio, bio, GFP_NOIO); in multipath_make_request()
126 mp_bh->bio.bi_iter.bi_sector += multipath->rdev->data_offset; in multipath_make_request()
127 mp_bh->bio.bi_opf |= REQ_FAILFAST_TRANSPORT; in multipath_make_request()
128 mp_bh->bio.bi_end_io = multipath_end_request; in multipath_make_request()
129 mp_bh->bio.bi_private = mp_bh; in multipath_make_request()
130 mddev_check_write_zeroes(mddev, &mp_bh->bio); in multipath_make_request()
131 submit_bio_noacct(&mp_bh->bio); in multipath_make_request()
289 struct multipath_bh *mp_bh; in multipathd() local
300 mp_bh = list_entry(head->prev, struct multipath_bh, retry_list); in multipathd()
304 bio = &mp_bh->bio; in multipathd()
305 bio->bi_iter.bi_sector = mp_bh->master_bio->bi_iter.bi_sector; in multipathd()
307 if ((mp_bh->path = multipath_map (conf))<0) { in multipathd()
311 multipath_end_bh_io(mp_bh, BLK_STS_IOERR); in multipathd()
316 *bio = *(mp_bh->master_bio); in multipathd()
318 conf->multipaths[mp_bh->path].rdev->data_offset; in multipathd()
319 bio_set_dev(bio, conf->multipaths[mp_bh->path].rdev->bdev); in multipathd()
322 bio->bi_private = mp_bh; in multipathd()