Commit fe3265b1 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer

dm: don't save and restore bi_private

Device mapper used the field bi_private to point to dm_target_io. However,
since kernel 3.15, the bi_private field is unused, and so the targets do
not need to save and restore this field.

This patch removes code that saves and restores bi_private from dm-cache,
dm-snapshot and dm-verity.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 086fbbbd
...@@ -118,14 +118,12 @@ static void iot_io_end(struct io_tracker *iot, sector_t len) ...@@ -118,14 +118,12 @@ static void iot_io_end(struct io_tracker *iot, sector_t len)
*/ */
struct dm_hook_info { struct dm_hook_info {
bio_end_io_t *bi_end_io; bio_end_io_t *bi_end_io;
void *bi_private;
}; };
static void dm_hook_bio(struct dm_hook_info *h, struct bio *bio, static void dm_hook_bio(struct dm_hook_info *h, struct bio *bio,
bio_end_io_t *bi_end_io, void *bi_private) bio_end_io_t *bi_end_io, void *bi_private)
{ {
h->bi_end_io = bio->bi_end_io; h->bi_end_io = bio->bi_end_io;
h->bi_private = bio->bi_private;
bio->bi_end_io = bi_end_io; bio->bi_end_io = bi_end_io;
bio->bi_private = bi_private; bio->bi_private = bi_private;
...@@ -134,7 +132,6 @@ static void dm_hook_bio(struct dm_hook_info *h, struct bio *bio, ...@@ -134,7 +132,6 @@ static void dm_hook_bio(struct dm_hook_info *h, struct bio *bio,
static void dm_unhook_bio(struct dm_hook_info *h, struct bio *bio) static void dm_unhook_bio(struct dm_hook_info *h, struct bio *bio)
{ {
bio->bi_end_io = h->bi_end_io; bio->bi_end_io = h->bi_end_io;
bio->bi_private = h->bi_private;
} }
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
......
...@@ -207,7 +207,6 @@ struct dm_snap_pending_exception { ...@@ -207,7 +207,6 @@ struct dm_snap_pending_exception {
*/ */
struct bio *full_bio; struct bio *full_bio;
bio_end_io_t *full_bio_end_io; bio_end_io_t *full_bio_end_io;
void *full_bio_private;
}; };
/* /*
...@@ -1485,10 +1484,8 @@ static void pending_complete(struct dm_snap_pending_exception *pe, int success) ...@@ -1485,10 +1484,8 @@ static void pending_complete(struct dm_snap_pending_exception *pe, int success)
snapshot_bios = bio_list_get(&pe->snapshot_bios); snapshot_bios = bio_list_get(&pe->snapshot_bios);
origin_bios = bio_list_get(&pe->origin_bios); origin_bios = bio_list_get(&pe->origin_bios);
full_bio = pe->full_bio; full_bio = pe->full_bio;
if (full_bio) { if (full_bio)
full_bio->bi_end_io = pe->full_bio_end_io; full_bio->bi_end_io = pe->full_bio_end_io;
full_bio->bi_private = pe->full_bio_private;
}
increment_pending_exceptions_done_count(); increment_pending_exceptions_done_count();
up_write(&s->lock); up_write(&s->lock);
...@@ -1605,7 +1602,6 @@ static void start_full_bio(struct dm_snap_pending_exception *pe, ...@@ -1605,7 +1602,6 @@ static void start_full_bio(struct dm_snap_pending_exception *pe,
pe->full_bio = bio; pe->full_bio = bio;
pe->full_bio_end_io = bio->bi_end_io; pe->full_bio_end_io = bio->bi_end_io;
pe->full_bio_private = bio->bi_private;
callback_data = dm_kcopyd_prepare_callback(s->kcopyd_client, callback_data = dm_kcopyd_prepare_callback(s->kcopyd_client,
copy_callback, pe); copy_callback, pe);
......
...@@ -83,9 +83,8 @@ struct dm_verity { ...@@ -83,9 +83,8 @@ struct dm_verity {
struct dm_verity_io { struct dm_verity_io {
struct dm_verity *v; struct dm_verity *v;
/* original values of bio->bi_end_io and bio->bi_private */ /* original value of bio->bi_end_io */
bio_end_io_t *orig_bi_end_io; bio_end_io_t *orig_bi_end_io;
void *orig_bi_private;
sector_t block; sector_t block;
unsigned n_blocks; unsigned n_blocks;
...@@ -453,7 +452,6 @@ static void verity_finish_io(struct dm_verity_io *io, int error) ...@@ -453,7 +452,6 @@ static void verity_finish_io(struct dm_verity_io *io, int error)
struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_bio_data_size); struct bio *bio = dm_bio_from_per_bio_data(io, v->ti->per_bio_data_size);
bio->bi_end_io = io->orig_bi_end_io; bio->bi_end_io = io->orig_bi_end_io;
bio->bi_private = io->orig_bi_private;
bio->bi_error = error; bio->bi_error = error;
bio_endio(bio); bio_endio(bio);
...@@ -566,7 +564,6 @@ static int verity_map(struct dm_target *ti, struct bio *bio) ...@@ -566,7 +564,6 @@ static int verity_map(struct dm_target *ti, struct bio *bio)
io = dm_per_bio_data(bio, ti->per_bio_data_size); io = dm_per_bio_data(bio, ti->per_bio_data_size);
io->v = v; io->v = v;
io->orig_bi_end_io = bio->bi_end_io; io->orig_bi_end_io = bio->bi_end_io;
io->orig_bi_private = bio->bi_private;
io->block = bio->bi_iter.bi_sector >> (v->data_dev_block_bits - SECTOR_SHIFT); io->block = bio->bi_iter.bi_sector >> (v->data_dev_block_bits - SECTOR_SHIFT);
io->n_blocks = bio->bi_iter.bi_size >> v->data_dev_block_bits; io->n_blocks = bio->bi_iter.bi_size >> v->data_dev_block_bits;
......
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