diff options
author | Mike Snitzer <snitzer@redhat.com> | 2012-07-27 10:08:00 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:00 -0400 |
commit | 542f90381422676544382d4071ba44a2de90a0c1 (patch) | |
tree | 0eae6798ab2fdef68a0eb1ea5ac14f3cc3ffb740 /drivers/md/dm-raid.c | |
parent | 1df05483d758ea43abc375869fbe06be506ba827 (diff) |
dm: support non power of two target max_io_len
Remove the restriction that limits a target's specified maximum incoming
I/O size to be a power of 2.
Rename this setting from 'split_io' to the less-ambiguous 'max_io_len'.
Change it from sector_t to uint32_t, which is plenty big enough, and
introduce a wrapper function dm_set_target_max_io_len() to set it.
Use sector_div() to process it now that it is not necessarily a power of 2.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r-- | drivers/md/dm-raid.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 017c34d78d61..858a8b70811c 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
@@ -353,6 +353,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv, | |||
353 | { | 353 | { |
354 | unsigned i, rebuild_cnt = 0; | 354 | unsigned i, rebuild_cnt = 0; |
355 | unsigned long value, region_size = 0; | 355 | unsigned long value, region_size = 0; |
356 | sector_t max_io_len; | ||
356 | char *key; | 357 | char *key; |
357 | 358 | ||
358 | /* | 359 | /* |
@@ -522,14 +523,12 @@ static int parse_raid_params(struct raid_set *rs, char **argv, | |||
522 | return -EINVAL; | 523 | return -EINVAL; |
523 | 524 | ||
524 | if (rs->md.chunk_sectors) | 525 | if (rs->md.chunk_sectors) |
525 | rs->ti->split_io = rs->md.chunk_sectors; | 526 | max_io_len = rs->md.chunk_sectors; |
526 | else | 527 | else |
527 | rs->ti->split_io = region_size; | 528 | max_io_len = region_size; |
528 | 529 | ||
529 | if (rs->md.chunk_sectors) | 530 | if (dm_set_target_max_io_len(rs->ti, max_io_len)) |
530 | rs->ti->split_io = rs->md.chunk_sectors; | 531 | return -EINVAL; |
531 | else | ||
532 | rs->ti->split_io = region_size; | ||
533 | 532 | ||
534 | /* Assume there are no metadata devices until the drives are parsed */ | 533 | /* Assume there are no metadata devices until the drives are parsed */ |
535 | rs->md.persistent = 0; | 534 | rs->md.persistent = 0; |