[Patch 4/5] dm: set io restriction defaults

Joe Thornber
2003-11-25T16:33:52Z

Make sure that a target has a sensible set of default io restrictions.
--- diff/drivers/md/dm-table.c 2003-11-25 15:47:38.000000000 +0000
+++ source/drivers/md/dm-table.c 2003-11-25 15:47:59.000000000 +0000
@@ -630,6 +630,16 @@
return 0;
}

+static void set_default_limits(struct io_restrictions *rs)
+{
+ rs->max_sectors = MAX_SECTORS;
+ rs->max_phys_segments = MAX_PHYS_SEGMENTS;
+ rs->max_hw_segments = MAX_HW_SEGMENTS;
+ rs->hardsect_size = 1 << SECTOR_SHIFT;
+ rs->max_segment_size = MAX_SEGMENT_SIZE;
+ rs->seg_boundary_mask = -1;
+}
+
int dm_table_add_target(struct dm_table *t, const char *type,
sector_t start, sector_t len, char *params)
{
@@ -642,6 +652,7 @@

tgt = t->targets + t->num_targets;
memset(tgt, 0, sizeof(*tgt));
+ set_default_limits(&tgt->limits);

tgt->type = dm_get_target_type(type);
if (!tgt->type) {