dm: remove unused 'num_write_bios' target interface
No DM target provides num_write_bios and none has since dm-cache's brief use in 2013. Having the possibility of num_write_bios > 1 complicates bio allocation. So remove the interface and assume there is only one bio needed. If a target ever needs more, it must provide a suitable bioset and allocate itself based on its particular needs. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
parent
18a25da843
commit
f31c21e436
|
@ -1323,28 +1323,18 @@ static int __clone_and_map_data_bio(struct clone_info *ci, struct dm_target *ti,
|
||||||
{
|
{
|
||||||
struct bio *bio = ci->bio;
|
struct bio *bio = ci->bio;
|
||||||
struct dm_target_io *tio;
|
struct dm_target_io *tio;
|
||||||
unsigned target_bio_nr;
|
int r;
|
||||||
unsigned num_target_bios = 1;
|
|
||||||
int r = 0;
|
|
||||||
|
|
||||||
/*
|
tio = alloc_tio(ci, ti, 0);
|
||||||
* Does the target want to receive duplicate copies of the bio?
|
|
||||||
*/
|
|
||||||
if (bio_data_dir(bio) == WRITE && ti->num_write_bios)
|
|
||||||
num_target_bios = ti->num_write_bios(ti, bio);
|
|
||||||
|
|
||||||
for (target_bio_nr = 0; target_bio_nr < num_target_bios; target_bio_nr++) {
|
|
||||||
tio = alloc_tio(ci, ti, target_bio_nr);
|
|
||||||
tio->len_ptr = len;
|
tio->len_ptr = len;
|
||||||
r = clone_bio(tio, bio, sector, *len);
|
r = clone_bio(tio, bio, sector, *len);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
free_tio(tio);
|
free_tio(tio);
|
||||||
break;
|
return r;
|
||||||
}
|
}
|
||||||
__map_bio(tio);
|
__map_bio(tio);
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef unsigned (*get_num_bios_fn)(struct dm_target *ti);
|
typedef unsigned (*get_num_bios_fn)(struct dm_target *ti);
|
||||||
|
|
|
@ -220,14 +220,6 @@ struct target_type {
|
||||||
#define DM_TARGET_WILDCARD 0x00000008
|
#define DM_TARGET_WILDCARD 0x00000008
|
||||||
#define dm_target_is_wildcard(type) ((type)->features & DM_TARGET_WILDCARD)
|
#define dm_target_is_wildcard(type) ((type)->features & DM_TARGET_WILDCARD)
|
||||||
|
|
||||||
/*
|
|
||||||
* Some targets need to be sent the same WRITE bio severals times so
|
|
||||||
* that they can send copies of it to different devices. This function
|
|
||||||
* examines any supplied bio and returns the number of copies of it the
|
|
||||||
* target requires.
|
|
||||||
*/
|
|
||||||
typedef unsigned (*dm_num_write_bios_fn) (struct dm_target *ti, struct bio *bio);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A target implements own bio data integrity.
|
* A target implements own bio data integrity.
|
||||||
*/
|
*/
|
||||||
|
@ -291,13 +283,6 @@ struct dm_target {
|
||||||
*/
|
*/
|
||||||
unsigned per_io_data_size;
|
unsigned per_io_data_size;
|
||||||
|
|
||||||
/*
|
|
||||||
* If defined, this function is called to find out how many
|
|
||||||
* duplicate bios should be sent to the target when writing
|
|
||||||
* data.
|
|
||||||
*/
|
|
||||||
dm_num_write_bios_fn num_write_bios;
|
|
||||||
|
|
||||||
/* target specific data */
|
/* target specific data */
|
||||||
void *private;
|
void *private;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue