Skip to content

Commit

Permalink
dm: rename request variables to bios
Browse files Browse the repository at this point in the history
Use 'bio' in the name of variables and functions that deal with
bios rather than 'request' to avoid confusion with the normal
block layer use of 'request'.

No functional changes.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
kergon committed Mar 1, 2013
1 parent bd2a49b commit 55a62ee
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 81 deletions.
6 changes: 3 additions & 3 deletions drivers/md/dm-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)

if (opt_params == 1 && opt_string &&
!strcasecmp(opt_string, "allow_discards"))
ti->num_discard_requests = 1;
ti->num_discard_bios = 1;
else if (opt_params) {
ret = -EINVAL;
ti->error = "Invalid feature arguments";
Expand Down Expand Up @@ -1665,7 +1665,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad;
}

ti->num_flush_requests = 1;
ti->num_flush_bios = 1;
ti->discard_zeroes_data_unsupported = true;

return 0;
Expand Down Expand Up @@ -1726,7 +1726,7 @@ static void crypt_status(struct dm_target *ti, status_type_t type,
DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset,
cc->dev->name, (unsigned long long)cc->start);

if (ti->num_discard_requests)
if (ti->num_discard_bios)
DMEMIT(" 1 allow_discards");

break;
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
mutex_init(&dc->timer_lock);
atomic_set(&dc->may_delay, 1);

ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->num_flush_bios = 1;
ti->num_discard_bios = 1;
ti->private = dc;
return 0;

Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-flakey.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad;
}

ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->num_flush_bios = 1;
ti->num_discard_bios = 1;
ti->per_bio_data_size = sizeof(struct per_bio_data);
ti->private = fc;
return 0;
Expand Down
6 changes: 3 additions & 3 deletions drivers/md/dm-linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad;
}

ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->num_write_same_requests = 1;
ti->num_flush_bios = 1;
ti->num_discard_bios = 1;
ti->num_write_same_bios = 1;
ti->private = lc;
return 0;

Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc,
goto bad;
}

ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->num_flush_bios = 1;
ti->num_discard_bios = 1;

return 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)

INIT_WORK(&rs->md.event_work, do_table_event);
ti->private = rs;
ti->num_flush_requests = 1;
ti->num_flush_bios = 1;

mutex_lock(&rs->md.reconfig_mutex);
ret = md_run(&rs->md);
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,8 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
if (r)
goto err_free_context;

ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->num_flush_bios = 1;
ti->num_discard_bios = 1;
ti->per_bio_data_size = sizeof(struct dm_raid1_bio_record);
ti->discard_zeroes_data_unsupported = true;

Expand Down
10 changes: 5 additions & 5 deletions drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
int i;
int r = -EINVAL;
char *origin_path, *cow_path;
unsigned args_used, num_flush_requests = 1;
unsigned args_used, num_flush_bios = 1;
fmode_t origin_mode = FMODE_READ;

if (argc != 4) {
Expand All @@ -1047,7 +1047,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}

if (dm_target_is_snapshot_merge(ti)) {
num_flush_requests = 2;
num_flush_bios = 2;
origin_mode = FMODE_WRITE;
}

Expand Down Expand Up @@ -1127,7 +1127,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
spin_lock_init(&s->tracked_chunk_lock);

ti->private = s;
ti->num_flush_requests = num_flush_requests;
ti->num_flush_bios = num_flush_bios;
ti->per_bio_data_size = sizeof(struct dm_snap_tracked_chunk);

/* Add snapshot to the list of snapshots for this origin */
Expand Down Expand Up @@ -1691,7 +1691,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
init_tracked_chunk(bio);

if (bio->bi_rw & REQ_FLUSH) {
if (!dm_bio_get_target_request_nr(bio))
if (!dm_bio_get_target_bio_nr(bio))
bio->bi_bdev = s->origin->bdev;
else
bio->bi_bdev = s->cow->bdev;
Expand Down Expand Up @@ -2102,7 +2102,7 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}

ti->private = dev;
ti->num_flush_requests = 1;
ti->num_flush_bios = 1;

return 0;
}
Expand Down
20 changes: 10 additions & 10 deletions drivers/md/dm-stripe.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
if (r)
return r;

ti->num_flush_requests = stripes;
ti->num_discard_requests = stripes;
ti->num_write_same_requests = stripes;
ti->num_flush_bios = stripes;
ti->num_discard_bios = stripes;
ti->num_write_same_bios = stripes;

sc->chunk_size = chunk_size;
if (chunk_size & (chunk_size - 1))
Expand Down Expand Up @@ -276,19 +276,19 @@ static int stripe_map(struct dm_target *ti, struct bio *bio)
{
struct stripe_c *sc = ti->private;
uint32_t stripe;
unsigned target_request_nr;
unsigned target_bio_nr;

if (bio->bi_rw & REQ_FLUSH) {
target_request_nr = dm_bio_get_target_request_nr(bio);
BUG_ON(target_request_nr >= sc->stripes);
bio->bi_bdev = sc->stripe[target_request_nr].dev->bdev;
target_bio_nr = dm_bio_get_target_bio_nr(bio);
BUG_ON(target_bio_nr >= sc->stripes);
bio->bi_bdev = sc->stripe[target_bio_nr].dev->bdev;
return DM_MAPIO_REMAPPED;
}
if (unlikely(bio->bi_rw & REQ_DISCARD) ||
unlikely(bio->bi_rw & REQ_WRITE_SAME)) {
target_request_nr = dm_bio_get_target_request_nr(bio);
BUG_ON(target_request_nr >= sc->stripes);
return stripe_map_range(sc, bio, target_request_nr);
target_bio_nr = dm_bio_get_target_bio_nr(bio);
BUG_ON(target_bio_nr >= sc->stripes);
return stripe_map_range(sc, bio, target_bio_nr);
}

stripe_map_sector(sc, bio->bi_sector, &stripe, &bio->bi_sector);
Expand Down
10 changes: 5 additions & 5 deletions drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,8 @@ int dm_table_add_target(struct dm_table *t, const char *type,

t->highs[t->num_targets++] = tgt->begin + tgt->len - 1;

if (!tgt->num_discard_requests && tgt->discards_supported)
DMWARN("%s: %s: ignoring discards_supported because num_discard_requests is zero.",
if (!tgt->num_discard_bios && tgt->discards_supported)
DMWARN("%s: %s: ignoring discards_supported because num_discard_bios is zero.",
dm_device_name(t->md), type);

return 0;
Expand Down Expand Up @@ -1359,7 +1359,7 @@ static bool dm_table_supports_flush(struct dm_table *t, unsigned flush)
while (i < dm_table_get_num_targets(t)) {
ti = dm_table_get_target(t, i++);

if (!ti->num_flush_requests)
if (!ti->num_flush_bios)
continue;

if (ti->flush_supported)
Expand Down Expand Up @@ -1438,7 +1438,7 @@ static bool dm_table_supports_write_same(struct dm_table *t)
while (i < dm_table_get_num_targets(t)) {
ti = dm_table_get_target(t, i++);

if (!ti->num_write_same_requests)
if (!ti->num_write_same_bios)
return false;

if (!ti->type->iterate_devices ||
Expand Down Expand Up @@ -1656,7 +1656,7 @@ bool dm_table_supports_discards(struct dm_table *t)
while (i < dm_table_get_num_targets(t)) {
ti = dm_table_get_target(t, i++);

if (!ti->num_discard_requests)
if (!ti->num_discard_bios)
continue;

if (ti->discards_supported)
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int io_err_ctr(struct dm_target *tt, unsigned int argc, char **args)
/*
* Return error for discards instead of -EOPNOTSUPP
*/
tt->num_discard_requests = 1;
tt->num_discard_bios = 1;

return 0;
}
Expand Down
12 changes: 6 additions & 6 deletions drivers/md/dm-thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,15 +1944,15 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv)
pt->data_dev = data_dev;
pt->low_water_blocks = low_water_blocks;
pt->adjusted_pf = pt->requested_pf = pf;
ti->num_flush_requests = 1;
ti->num_flush_bios = 1;

/*
* Only need to enable discards if the pool should pass
* them down to the data device. The thin device's discard
* processing will cause mappings to be removed from the btree.
*/
if (pf.discard_enabled && pf.discard_passdown) {
ti->num_discard_requests = 1;
ti->num_discard_bios = 1;

/*
* Setting 'discards_supported' circumvents the normal
Expand Down Expand Up @@ -2593,17 +2593,17 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv)
if (r)
goto bad_thin_open;

ti->num_flush_requests = 1;
ti->num_flush_bios = 1;
ti->flush_supported = true;
ti->per_bio_data_size = sizeof(struct dm_thin_endio_hook);

/* In case the pool supports discards, pass them on. */
if (tc->pool->pf.discard_enabled) {
ti->discards_supported = true;
ti->num_discard_requests = 1;
ti->num_discard_bios = 1;
ti->discard_zeroes_data_unsupported = true;
/* Discard requests must be split on a block boundary */
ti->split_discard_requests = true;
/* Discard bios must be split on a block boundary */
ti->split_discard_bios = true;
}

dm_put(pool_md);
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
/*
* Silently drop discards, avoiding -EOPNOTSUPP.
*/
ti->num_discard_requests = 1;
ti->num_discard_bios = 1;

return 0;
}
Expand Down
Loading

0 comments on commit 55a62ee

Please sign in to comment.