Commit eafc59ae authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dm: default queue limits

From: Joe Thornber <thornber@redhat.com>

Fill in missing queue limitations when table is complete instead of enforcing
the "default" limits on every dm device.  Problem noticed by Mike Christie.

[Christophe Saout]
parent 2c99d295
......@@ -629,13 +629,19 @@ static int split_args(int *argc, char ***argvp, char *input)
return 0;
}
static void set_default_limits(struct io_restrictions *rs)
static void check_for_valid_limits(struct io_restrictions *rs)
{
if (!rs->max_sectors)
rs->max_sectors = MAX_SECTORS;
if (!rs->max_phys_segments)
rs->max_phys_segments = MAX_PHYS_SEGMENTS;
if (!rs->max_hw_segments)
rs->max_hw_segments = MAX_HW_SEGMENTS;
if (!rs->hardsect_size)
rs->hardsect_size = 1 << SECTOR_SHIFT;
if (!rs->max_segment_size)
rs->max_segment_size = MAX_SEGMENT_SIZE;
if (!rs->seg_boundary_mask)
rs->seg_boundary_mask = -1;
}
......@@ -651,7 +657,6 @@ int dm_table_add_target(struct dm_table *t, const char *type,
tgt = t->targets + t->num_targets;
memset(tgt, 0, sizeof(*tgt));
set_default_limits(&tgt->limits);
if (!len) {
tgt->error = "zero-length target";
......@@ -736,6 +741,8 @@ int dm_table_complete(struct dm_table *t)
int r = 0;
unsigned int leaf_nodes;
check_for_valid_limits(&t->limits);
/* how many indexes will the btree have ? */
leaf_nodes = dm_div_up(t->num_targets, KEYS_PER_NODE);
t->depth = 1 + int_log(leaf_nodes, CHILDREN_PER_NODE);
......
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