Skip to content

Commit 7de3ee5

Browse files
Mikulas Patockakergon
authored andcommitted
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: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent ee18026 commit 7de3ee5

File tree

14 files changed

+31
-54
lines changed

14 files changed

+31
-54
lines changed

drivers/md/dm-crypt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,8 +1689,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
16891689
return ret;
16901690
}
16911691

1692-
static int crypt_map(struct dm_target *ti, struct bio *bio,
1693-
union map_info *map_context)
1692+
static int crypt_map(struct dm_target *ti, struct bio *bio)
16941693
{
16951694
struct dm_crypt_io *io;
16961695
struct crypt_config *cc = ti->private;
@@ -1846,7 +1845,7 @@ static int crypt_iterate_devices(struct dm_target *ti,
18461845

18471846
static struct target_type crypt_target = {
18481847
.name = "crypt",
1849-
.version = {1, 11, 0},
1848+
.version = {1, 12, 0},
18501849
.module = THIS_MODULE,
18511850
.ctr = crypt_ctr,
18521851
.dtr = crypt_dtr,

drivers/md/dm-delay.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,7 @@ static void delay_resume(struct dm_target *ti)
274274
atomic_set(&dc->may_delay, 1);
275275
}
276276

277-
static int delay_map(struct dm_target *ti, struct bio *bio,
278-
union map_info *map_context)
277+
static int delay_map(struct dm_target *ti, struct bio *bio)
279278
{
280279
struct delay_c *dc = ti->private;
281280

@@ -338,7 +337,7 @@ static int delay_iterate_devices(struct dm_target *ti,
338337

339338
static struct target_type delay_target = {
340339
.name = "delay",
341-
.version = {1, 1, 0},
340+
.version = {1, 2, 0},
342341
.module = THIS_MODULE,
343342
.ctr = delay_ctr,
344343
.dtr = delay_dtr,

drivers/md/dm-flakey.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ static void corrupt_bio_data(struct bio *bio, struct flakey_c *fc)
270270
}
271271
}
272272

273-
static int flakey_map(struct dm_target *ti, struct bio *bio,
274-
union map_info *map_context)
273+
static int flakey_map(struct dm_target *ti, struct bio *bio)
275274
{
276275
struct flakey_c *fc = ti->private;
277276
unsigned elapsed;
@@ -321,8 +320,7 @@ static int flakey_map(struct dm_target *ti, struct bio *bio,
321320
return DM_MAPIO_REMAPPED;
322321
}
323322

324-
static int flakey_end_io(struct dm_target *ti, struct bio *bio,
325-
int error, union map_info *map_context)
323+
static int flakey_end_io(struct dm_target *ti, struct bio *bio, int error)
326324
{
327325
struct flakey_c *fc = ti->private;
328326
struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));

drivers/md/dm-linear.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ static void linear_map_bio(struct dm_target *ti, struct bio *bio)
8888
bio->bi_sector = linear_map_sector(ti, bio->bi_sector);
8989
}
9090

91-
static int linear_map(struct dm_target *ti, struct bio *bio,
92-
union map_info *map_context)
91+
static int linear_map(struct dm_target *ti, struct bio *bio)
9392
{
9493
linear_map_bio(ti, bio);
9594

drivers/md/dm-raid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ static void raid_dtr(struct dm_target *ti)
12181218
context_free(rs);
12191219
}
12201220

1221-
static int raid_map(struct dm_target *ti, struct bio *bio, union map_info *map_context)
1221+
static int raid_map(struct dm_target *ti, struct bio *bio)
12221222
{
12231223
struct raid_set *rs = ti->private;
12241224
struct mddev *mddev = &rs->md;
@@ -1432,7 +1432,7 @@ static void raid_resume(struct dm_target *ti)
14321432

14331433
static struct target_type raid_target = {
14341434
.name = "raid",
1435-
.version = {1, 3, 1},
1435+
.version = {1, 4, 0},
14361436
.module = THIS_MODULE,
14371437
.ctr = raid_ctr,
14381438
.dtr = raid_dtr,

drivers/md/dm-raid1.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,8 +1142,7 @@ static void mirror_dtr(struct dm_target *ti)
11421142
/*
11431143
* Mirror mapping function
11441144
*/
1145-
static int mirror_map(struct dm_target *ti, struct bio *bio,
1146-
union map_info *map_context)
1145+
static int mirror_map(struct dm_target *ti, struct bio *bio)
11471146
{
11481147
int r, rw = bio_rw(bio);
11491148
struct mirror *m;
@@ -1192,8 +1191,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio,
11921191
return DM_MAPIO_REMAPPED;
11931192
}
11941193

1195-
static int mirror_end_io(struct dm_target *ti, struct bio *bio,
1196-
int error, union map_info *map_context)
1194+
static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
11971195
{
11981196
int rw = bio_rw(bio);
11991197
struct mirror_set *ms = (struct mirror_set *) ti->private;

drivers/md/dm-snap.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,8 +1567,7 @@ static void remap_exception(struct dm_snapshot *s, struct dm_exception *e,
15671567
s->store->chunk_mask);
15681568
}
15691569

1570-
static int snapshot_map(struct dm_target *ti, struct bio *bio,
1571-
union map_info *map_context)
1570+
static int snapshot_map(struct dm_target *ti, struct bio *bio)
15721571
{
15731572
struct dm_exception *e;
15741573
struct dm_snapshot *s = ti->private;
@@ -1683,8 +1682,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
16831682
* If merging is currently taking place on the chunk in question, the
16841683
* I/O is deferred by adding it to s->bios_queued_during_merge.
16851684
*/
1686-
static int snapshot_merge_map(struct dm_target *ti, struct bio *bio,
1687-
union map_info *map_context)
1685+
static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
16881686
{
16891687
struct dm_exception *e;
16901688
struct dm_snapshot *s = ti->private;
@@ -1744,8 +1742,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio,
17441742
return r;
17451743
}
17461744

1747-
static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
1748-
int error, union map_info *map_context)
1745+
static int snapshot_end_io(struct dm_target *ti, struct bio *bio, int error)
17491746
{
17501747
struct dm_snapshot *s = ti->private;
17511748

@@ -2119,8 +2116,7 @@ static void origin_dtr(struct dm_target *ti)
21192116
dm_put_device(ti, dev);
21202117
}
21212118

2122-
static int origin_map(struct dm_target *ti, struct bio *bio,
2123-
union map_info *map_context)
2119+
static int origin_map(struct dm_target *ti, struct bio *bio)
21242120
{
21252121
struct dm_dev *dev = ti->private;
21262122
bio->bi_bdev = dev->bdev;

drivers/md/dm-stripe.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ static int stripe_map_discard(struct stripe_c *sc, struct bio *bio,
271271
}
272272
}
273273

274-
static int stripe_map(struct dm_target *ti, struct bio *bio,
275-
union map_info *map_context)
274+
static int stripe_map(struct dm_target *ti, struct bio *bio)
276275
{
277276
struct stripe_c *sc = ti->private;
278277
uint32_t stripe;
@@ -342,8 +341,7 @@ static int stripe_status(struct dm_target *ti, status_type_t type,
342341
return 0;
343342
}
344343

345-
static int stripe_end_io(struct dm_target *ti, struct bio *bio,
346-
int error, union map_info *map_context)
344+
static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
347345
{
348346
unsigned i;
349347
char major_minor[16];

drivers/md/dm-target.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,14 @@ static void io_err_dtr(struct dm_target *tt)
126126
/* empty */
127127
}
128128

129-
static int io_err_map(struct dm_target *tt, struct bio *bio,
130-
union map_info *map_context)
129+
static int io_err_map(struct dm_target *tt, struct bio *bio)
131130
{
132131
return -EIO;
133132
}
134133

135134
static struct target_type error_target = {
136135
.name = "error",
137-
.version = {1, 0, 1},
136+
.version = {1, 1, 0},
138137
.ctr = io_err_ctr,
139138
.dtr = io_err_dtr,
140139
.map = io_err_map,

drivers/md/dm-thin.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,7 @@ static void thin_hook_bio(struct thin_c *tc, struct bio *bio)
13711371
/*
13721372
* Non-blocking function called from the thin target's map function.
13731373
*/
1374-
static int thin_bio_map(struct dm_target *ti, struct bio *bio,
1375-
union map_info *map_context)
1374+
static int thin_bio_map(struct dm_target *ti, struct bio *bio)
13761375
{
13771376
int r;
13781377
struct thin_c *tc = ti->private;
@@ -1980,8 +1979,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
19801979
return r;
19811980
}
19821981

1983-
static int pool_map(struct dm_target *ti, struct bio *bio,
1984-
union map_info *map_context)
1982+
static int pool_map(struct dm_target *ti, struct bio *bio)
19851983
{
19861984
int r;
19871985
struct pool_c *pt = ti->private;
@@ -2626,17 +2624,14 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv)
26262624
return r;
26272625
}
26282626

2629-
static int thin_map(struct dm_target *ti, struct bio *bio,
2630-
union map_info *map_context)
2627+
static int thin_map(struct dm_target *ti, struct bio *bio)
26312628
{
26322629
bio->bi_sector = dm_target_offset(ti, bio->bi_sector);
26332630

2634-
return thin_bio_map(ti, bio, map_context);
2631+
return thin_bio_map(ti, bio);
26352632
}
26362633

2637-
static int thin_endio(struct dm_target *ti,
2638-
struct bio *bio, int err,
2639-
union map_info *map_context)
2634+
static int thin_endio(struct dm_target *ti, struct bio *bio, int err)
26402635
{
26412636
unsigned long flags;
26422637
struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));

drivers/md/dm-verity.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,7 @@ static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io)
458458
* Bio map function. It allocates dm_verity_io structure and bio vector and
459459
* fills them. Then it issues prefetches and the I/O.
460460
*/
461-
static int verity_map(struct dm_target *ti, struct bio *bio,
462-
union map_info *map_context)
461+
static int verity_map(struct dm_target *ti, struct bio *bio)
463462
{
464463
struct dm_verity *v = ti->private;
465464
struct dm_verity_io *io;

drivers/md/dm-zero.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
3333
/*
3434
* Return zeros only on reads
3535
*/
36-
static int zero_map(struct dm_target *ti, struct bio *bio,
37-
union map_info *map_context)
36+
static int zero_map(struct dm_target *ti, struct bio *bio)
3837
{
3938
switch(bio_rw(bio)) {
4039
case READ:
@@ -56,7 +55,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio,
5655

5756
static struct target_type zero_target = {
5857
.name = "zero",
59-
.version = {1, 0, 0},
58+
.version = {1, 1, 0},
6059
.module = THIS_MODULE,
6160
.ctr = zero_ctr,
6261
.map = zero_map,

drivers/md/dm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static void clone_endio(struct bio *bio, int error)
645645
error = -EIO;
646646

647647
if (endio) {
648-
r = endio(tio->ti, bio, error, &tio->info);
648+
r = endio(tio->ti, bio, error);
649649
if (r < 0 || r == DM_ENDIO_REQUEUE)
650650
/*
651651
* error and requeue request are handled
@@ -1004,7 +1004,7 @@ static void __map_bio(struct dm_target *ti, struct dm_target_io *tio)
10041004
*/
10051005
atomic_inc(&tio->io->io_count);
10061006
sector = clone->bi_sector;
1007-
r = ti->type->map(ti, clone, &tio->info);
1007+
r = ti->type->map(ti, clone);
10081008
if (r == DM_MAPIO_REMAPPED) {
10091009
/* the bio has been remapped so dispatch it */
10101010

include/linux/device-mapper.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
4545
* = 1: simple remap complete
4646
* = 2: The target wants to push back the io
4747
*/
48-
typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
49-
union map_info *map_context);
48+
typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio);
5049
typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
5150
union map_info *map_context);
5251

@@ -59,8 +58,7 @@ typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
5958
* 2 : The target wants to push back the io
6059
*/
6160
typedef int (*dm_endio_fn) (struct dm_target *ti,
62-
struct bio *bio, int error,
63-
union map_info *map_context);
61+
struct bio *bio, int error);
6462
typedef int (*dm_request_endio_fn) (struct dm_target *ti,
6563
struct request *clone, int error,
6664
union map_info *map_context);

0 commit comments

Comments
 (0)