Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21a52c6d authored by NeilBrown's avatar NeilBrown
Browse files

md: pass mddev to make_request functions rather than request_queue



We used to pass the personality make_request function direct
to the block layer so the first argument had to be a queue.
But now we have the intermediary md_make_request so it makes
at lot more sense to pass a struct mddev_s.
It makes it possible to have an mddev without its own queue too.

Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent cca9cf90
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -168,9 +168,8 @@ static void add_sector(conf_t *conf, sector_t start, int mode)
		conf->nfaults = n+1;
}

static int make_request(struct request_queue *q, struct bio *bio)
static int make_request(mddev_t *mddev, struct bio *bio)
{
	mddev_t *mddev = q->queuedata;
	conf_t *conf = mddev->private;
	int failit = 0;

+3 −4
Original line number Diff line number Diff line
@@ -286,9 +286,8 @@ static int linear_stop (mddev_t *mddev)
	return 0;
}

static int linear_make_request (struct request_queue *q, struct bio *bio)
static int linear_make_request (mddev_t *mddev, struct bio *bio)
{
	mddev_t *mddev = q->queuedata;
	dev_info_t *tmp_dev;
	sector_t start_sector;

@@ -328,9 +327,9 @@ static int linear_make_request (struct request_queue *q, struct bio *bio)

		bp = bio_split(bio, end_sector - bio->bi_sector);

		if (linear_make_request(q, &bp->bio1))
		if (linear_make_request(mddev, &bp->bio1))
			generic_make_request(&bp->bio1);
		if (linear_make_request(q, &bp->bio2))
		if (linear_make_request(mddev, &bp->bio2))
			generic_make_request(&bp->bio2);
		bio_pair_release(bp);
		return 0;
+2 −2
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
	atomic_inc(&mddev->active_io);
	rcu_read_unlock();

	rv = mddev->pers->make_request(q, bio);
	rv = mddev->pers->make_request(mddev, bio);

	cpu = part_stat_lock();
	part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
@@ -354,7 +354,7 @@ static void md_submit_barrier(struct work_struct *ws)
		bio_endio(bio, 0);
	else {
		bio->bi_rw &= ~(1<<BIO_RW_BARRIER);
		if (mddev->pers->make_request(mddev->queue, bio))
		if (mddev->pers->make_request(mddev, bio))
			generic_make_request(bio);
		mddev->barrier = POST_REQUEST_BARRIER;
		submit_barriers(mddev);
+1 −1
Original line number Diff line number Diff line
@@ -330,7 +330,7 @@ struct mdk_personality
	int level;
	struct list_head list;
	struct module *owner;
	int (*make_request)(struct request_queue *q, struct bio *bio);
	int (*make_request)(mddev_t *mddev, struct bio *bio);
	int (*run)(mddev_t *mddev);
	int (*stop)(mddev_t *mddev);
	void (*status)(struct seq_file *seq, mddev_t *mddev);
+1 −2
Original line number Diff line number Diff line
@@ -135,9 +135,8 @@ static void multipath_unplug(struct request_queue *q)
}


static int multipath_make_request (struct request_queue *q, struct bio * bio)
static int multipath_make_request(mddev_t *mddev, struct bio * bio)
{
	mddev_t *mddev = q->queuedata;
	multipath_conf_t *conf = mddev->private;
	struct multipath_bh * mp_bh;
	struct multipath_info *multipath;
Loading