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-raid1.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-raid1.c')
-rw-r--r-- | drivers/md/dm-raid1.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index b58b7a33914a..819ccba65912 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -1081,7 +1081,11 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | ti->private = ms; | 1083 | ti->private = ms; |
1084 | ti->split_io = dm_rh_get_region_size(ms->rh); | 1084 | |
1085 | r = dm_set_target_max_io_len(ti, dm_rh_get_region_size(ms->rh)); | ||
1086 | if (r) | ||
1087 | goto err_free_context; | ||
1088 | |||
1085 | ti->num_flush_requests = 1; | 1089 | ti->num_flush_requests = 1; |
1086 | ti->num_discard_requests = 1; | 1090 | ti->num_discard_requests = 1; |
1087 | ti->discard_zeroes_data_unsupported = 1; | 1091 | ti->discard_zeroes_data_unsupported = 1; |