Commit 7de3ee57 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon

dm: remove map_info

This patch removes map_info from bio-based device mapper targets.
map_info is still used for request-based targets.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent ee18026a
...@@ -1689,8 +1689,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -1689,8 +1689,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
return ret; return ret;
} }
static int crypt_map(struct dm_target *ti, struct bio *bio, static int crypt_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct dm_crypt_io *io; struct dm_crypt_io *io;
struct crypt_config *cc = ti->private; struct crypt_config *cc = ti->private;
...@@ -1846,7 +1845,7 @@ static int crypt_iterate_devices(struct dm_target *ti, ...@@ -1846,7 +1845,7 @@ static int crypt_iterate_devices(struct dm_target *ti,
static struct target_type crypt_target = { static struct target_type crypt_target = {
.name = "crypt", .name = "crypt",
.version = {1, 11, 0}, .version = {1, 12, 0},
.module = THIS_MODULE, .module = THIS_MODULE,
.ctr = crypt_ctr, .ctr = crypt_ctr,
.dtr = crypt_dtr, .dtr = crypt_dtr,
......
...@@ -274,8 +274,7 @@ static void delay_resume(struct dm_target *ti) ...@@ -274,8 +274,7 @@ static void delay_resume(struct dm_target *ti)
atomic_set(&dc->may_delay, 1); atomic_set(&dc->may_delay, 1);
} }
static int delay_map(struct dm_target *ti, struct bio *bio, static int delay_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct delay_c *dc = ti->private; struct delay_c *dc = ti->private;
...@@ -338,7 +337,7 @@ static int delay_iterate_devices(struct dm_target *ti, ...@@ -338,7 +337,7 @@ static int delay_iterate_devices(struct dm_target *ti,
static struct target_type delay_target = { static struct target_type delay_target = {
.name = "delay", .name = "delay",
.version = {1, 1, 0}, .version = {1, 2, 0},
.module = THIS_MODULE, .module = THIS_MODULE,
.ctr = delay_ctr, .ctr = delay_ctr,
.dtr = delay_dtr, .dtr = delay_dtr,
......
...@@ -270,8 +270,7 @@ static void corrupt_bio_data(struct bio *bio, struct flakey_c *fc) ...@@ -270,8 +270,7 @@ static void corrupt_bio_data(struct bio *bio, struct flakey_c *fc)
} }
} }
static int flakey_map(struct dm_target *ti, struct bio *bio, static int flakey_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct flakey_c *fc = ti->private; struct flakey_c *fc = ti->private;
unsigned elapsed; unsigned elapsed;
...@@ -321,8 +320,7 @@ static int flakey_map(struct dm_target *ti, struct bio *bio, ...@@ -321,8 +320,7 @@ static int flakey_map(struct dm_target *ti, struct bio *bio,
return DM_MAPIO_REMAPPED; return DM_MAPIO_REMAPPED;
} }
static int flakey_end_io(struct dm_target *ti, struct bio *bio, static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error)
int error, union map_info *map_context)
{ {
struct flakey_c *fc = ti->private; struct flakey_c *fc = ti->private;
struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
......
...@@ -88,8 +88,7 @@ static void linear_map_bio(struct dm_target *ti, struct bio *bio) ...@@ -88,8 +88,7 @@ static void linear_map_bio(struct dm_target *ti, struct bio *bio)
bio->bi_sector = linear_map_sector(ti, bio->bi_sector); bio->bi_sector = linear_map_sector(ti, bio->bi_sector);
} }
static int linear_map(struct dm_target *ti, struct bio *bio, static int linear_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
linear_map_bio(ti, bio); linear_map_bio(ti, bio);
......
...@@ -1218,7 +1218,7 @@ static void raid_dtr(struct dm_target *ti) ...@@ -1218,7 +1218,7 @@ static void raid_dtr(struct dm_target *ti)
context_free(rs); context_free(rs);
} }
static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context) static int raid_map(struct dm_target *ti, struct bio *bio)
{ {
struct raid_set *rs = ti->private; struct raid_set *rs = ti->private;
struct mddev *mddev = &rs->md; struct mddev *mddev = &rs->md;
...@@ -1432,7 +1432,7 @@ static void raid_resume(struct dm_target *ti) ...@@ -1432,7 +1432,7 @@ static void raid_resume(struct dm_target *ti)
static struct target_type raid_target = { static struct target_type raid_target = {
.name = "raid", .name = "raid",
.version = {1, 3, 1}, .version = {1, 4, 0},
.module = THIS_MODULE, .module = THIS_MODULE,
.ctr = raid_ctr, .ctr = raid_ctr,
.dtr = raid_dtr, .dtr = raid_dtr,
......
...@@ -1142,8 +1142,7 @@ static void mirror_dtr(struct dm_target *ti) ...@@ -1142,8 +1142,7 @@ static void mirror_dtr(struct dm_target *ti)
/* /*
* Mirror mapping function * Mirror mapping function
*/ */
static int mirror_map(struct dm_target *ti, struct bio *bio, static int mirror_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
int r, rw = bio_rw(bio); int r, rw = bio_rw(bio);
struct mirror *m; struct mirror *m;
...@@ -1192,8 +1191,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio, ...@@ -1192,8 +1191,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio,
return DM_MAPIO_REMAPPED; return DM_MAPIO_REMAPPED;
} }
static int mirror_end_io(struct dm_target *ti, struct bio *bio, static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
int error, union map_info *map_context)
{ {
int rw = bio_rw(bio); int rw = bio_rw(bio);
struct mirror_set *ms = (struct mirror_set *) ti->private; struct mirror_set *ms = (struct mirror_set *) ti->private;
......
...@@ -1567,8 +1567,7 @@ static void remap_exception(struct dm_snapshot *s, struct dm_exception *e, ...@@ -1567,8 +1567,7 @@ static void remap_exception(struct dm_snapshot *s, struct dm_exception *e,
s->store->chunk_mask); s->store->chunk_mask);
} }
static int snapshot_map(struct dm_target *ti, struct bio *bio, static int snapshot_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct dm_exception *e; struct dm_exception *e;
struct dm_snapshot *s = ti->private; struct dm_snapshot *s = ti->private;
...@@ -1683,8 +1682,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio, ...@@ -1683,8 +1682,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
* If merging is currently taking place on the chunk in question, the * If merging is currently taking place on the chunk in question, the
* I/O is deferred by adding it to s->bios_queued_during_merge. * I/O is deferred by adding it to s->bios_queued_during_merge.
*/ */
static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct dm_exception *e; struct dm_exception *e;
struct dm_snapshot *s = ti->private; struct dm_snapshot *s = ti->private;
...@@ -1744,8 +1742,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, ...@@ -1744,8 +1742,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio,
return r; return r;
} }
static int snapshot_end_io(struct dm_target *ti, struct bio *bio, static int snapshot_end_io(struct dm_target *ti, struct bio *bio, int error)
int error, union map_info *map_context)
{ {
struct dm_snapshot *s = ti->private; struct dm_snapshot *s = ti->private;
...@@ -2119,8 +2116,7 @@ static void origin_dtr(struct dm_target *ti) ...@@ -2119,8 +2116,7 @@ static void origin_dtr(struct dm_target *ti)
dm_put_device(ti, dev); dm_put_device(ti, dev);
} }
static int origin_map(struct dm_target *ti, struct bio *bio, static int origin_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct dm_dev *dev = ti->private; struct dm_dev *dev = ti->private;
bio->bi_bdev = dev->bdev; bio->bi_bdev = dev->bdev;
......
...@@ -271,8 +271,7 @@ static int stripe_map_discard(struct stripe_c *sc, struct bio *bio, ...@@ -271,8 +271,7 @@ static int stripe_map_discard(struct stripe_c *sc, struct bio *bio,
} }
} }
static int stripe_map(struct dm_target *ti, struct bio *bio, static int stripe_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct stripe_c *sc = ti->private; struct stripe_c *sc = ti->private;
uint32_t stripe; uint32_t stripe;
...@@ -342,8 +341,7 @@ static int stripe_status(struct dm_target *ti, status_type_t type, ...@@ -342,8 +341,7 @@ static int stripe_status(struct dm_target *ti, status_type_t type,
return 0; return 0;
} }
static int stripe_end_io(struct dm_target *ti, struct bio *bio, static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
int error, union map_info *map_context)
{ {
unsigned i; unsigned i;
char major_minor[16]; char major_minor[16];
......
...@@ -126,15 +126,14 @@ static void io_err_dtr(struct dm_target *tt) ...@@ -126,15 +126,14 @@ static void io_err_dtr(struct dm_target *tt)
/* empty */ /* empty */
} }
static int io_err_map(struct dm_target *tt, struct bio *bio, static int io_err_map(struct dm_target *tt, struct bio *bio)
union map_info *map_context)
{ {
return -EIO; return -EIO;
} }
static struct target_type error_target = { static struct target_type error_target = {
.name = "error", .name = "error",
.version = {1, 0, 1}, .version = {1, 1, 0},
.ctr = io_err_ctr, .ctr = io_err_ctr,
.dtr = io_err_dtr, .dtr = io_err_dtr,
.map = io_err_map, .map = io_err_map,
......
...@@ -1371,8 +1371,7 @@ static void thin_hook_bio(struct thin_c *tc, struct bio *bio) ...@@ -1371,8 +1371,7 @@ static void thin_hook_bio(struct thin_c *tc, struct bio *bio)
/* /*
* Non-blocking function called from the thin target's map function. * Non-blocking function called from the thin target's map function.
*/ */
static int thin_bio_map(struct dm_target *ti, struct bio *bio, static int thin_bio_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
int r; int r;
struct thin_c *tc = ti->private; struct thin_c *tc = ti->private;
...@@ -1980,8 +1979,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) ...@@ -1980,8 +1979,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
return r; return r;
} }
static int pool_map(struct dm_target *ti, struct bio *bio, static int pool_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
int r; int r;
struct pool_c *pt = ti->private; struct pool_c *pt = ti->private;
...@@ -2626,17 +2624,14 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) ...@@ -2626,17 +2624,14 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv)
return r; return r;
} }
static int thin_map(struct dm_target *ti, struct bio *bio, static int thin_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
bio->bi_sector = dm_target_offset(ti, bio->bi_sector); bio->bi_sector = dm_target_offset(ti, bio->bi_sector);
return thin_bio_map(ti, bio, map_context); return thin_bio_map(ti, bio);
} }
static int thin_endio(struct dm_target *ti, static int thin_endio(struct dm_target *ti, struct bio *bio, int err)
struct bio *bio, int err,
union map_info *map_context)
{ {
unsigned long flags; unsigned long flags;
struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook)); struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));
......
...@@ -458,8 +458,7 @@ static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io) ...@@ -458,8 +458,7 @@ static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io)
* Bio map function. It allocates dm_verity_io structure and bio vector and * Bio map function. It allocates dm_verity_io structure and bio vector and
* fills them. Then it issues prefetches and the I/O. * fills them. Then it issues prefetches and the I/O.
*/ */
static int verity_map(struct dm_target *ti, struct bio *bio, static int verity_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
struct dm_verity *v = ti->private; struct dm_verity *v = ti->private;
struct dm_verity_io *io; struct dm_verity_io *io;
......
...@@ -33,8 +33,7 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -33,8 +33,7 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
/* /*
* Return zeros only on reads * Return zeros only on reads
*/ */
static int zero_map(struct dm_target *ti, struct bio *bio, static int zero_map(struct dm_target *ti, struct bio *bio)
union map_info *map_context)
{ {
switch(bio_rw(bio)) { switch(bio_rw(bio)) {
case READ: case READ:
...@@ -56,7 +55,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio, ...@@ -56,7 +55,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio,
static struct target_type zero_target = { static struct target_type zero_target = {
.name = "zero", .name = "zero",
.version = {1, 0, 0}, .version = {1, 1, 0},
.module = THIS_MODULE, .module = THIS_MODULE,
.ctr = zero_ctr, .ctr = zero_ctr,
.map = zero_map, .map = zero_map,
......
...@@ -645,7 +645,7 @@ static void clone_endio(struct bio *bio, int error) ...@@ -645,7 +645,7 @@ static void clone_endio(struct bio *bio, int error)
error = -EIO; error = -EIO;
if (endio) { if (endio) {
r = endio(tio->ti, bio, error, &tio->info); r = endio(tio->ti, bio, error);
if (r < 0 || r == DM_ENDIO_REQUEUE) if (r < 0 || r == DM_ENDIO_REQUEUE)
/* /*
* error and requeue request are handled * error and requeue request are handled
...@@ -1004,7 +1004,7 @@ static void __map_bio(struct dm_target *ti, struct dm_target_io *tio) ...@@ -1004,7 +1004,7 @@ static void __map_bio(struct dm_target *ti, struct dm_target_io *tio)
*/ */
atomic_inc(&tio->io->io_count); atomic_inc(&tio->io->io_count);
sector = clone->bi_sector; sector = clone->bi_sector;
r = ti->type->map(ti, clone, &tio->info); r = ti->type->map(ti, clone);
if (r == DM_MAPIO_REMAPPED) { if (r == DM_MAPIO_REMAPPED) {
/* the bio has been remapped so dispatch it */ /* the bio has been remapped so dispatch it */
......
...@@ -45,8 +45,7 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti); ...@@ -45,8 +45,7 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
* = 1: simple remap complete * = 1: simple remap complete
* = 2: The target wants to push back the io * = 2: The target wants to push back the io
*/ */
typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio);
union map_info *map_context);
typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
union map_info *map_context); union map_info *map_context);
...@@ -59,8 +58,7 @@ typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, ...@@ -59,8 +58,7 @@ typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
* 2 : The target wants to push back the io * 2 : The target wants to push back the io
*/ */
typedef int (*dm_endio_fn) (struct dm_target *ti, typedef int (*dm_endio_fn) (struct dm_target *ti,
struct bio *bio, int error, struct bio *bio, int error);
union map_info *map_context);
typedef int (*dm_request_endio_fn) (struct dm_target *ti, typedef int (*dm_request_endio_fn) (struct dm_target *ti,
struct request *clone, int error, struct request *clone, int error,
union map_info *map_context); union map_info *map_context);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment