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 /include/linux/device-mapper.h | |
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 'include/linux/device-mapper.h')
-rw-r--r-- | include/linux/device-mapper.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index d70cbb2ada25..b19c1e189a68 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -186,8 +186,8 @@ struct dm_target { | |||
186 | sector_t begin; | 186 | sector_t begin; |
187 | sector_t len; | 187 | sector_t len; |
188 | 188 | ||
189 | /* Always a power of 2 */ | 189 | /* If non-zero, maximum size of I/O submitted to a target. */ |
190 | sector_t split_io; | 190 | uint32_t max_io_len; |
191 | 191 | ||
192 | /* | 192 | /* |
193 | * A number of zero-length barrier requests that will be submitted | 193 | * A number of zero-length barrier requests that will be submitted |
@@ -358,6 +358,11 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback | |||
358 | int dm_table_complete(struct dm_table *t); | 358 | int dm_table_complete(struct dm_table *t); |
359 | 359 | ||
360 | /* | 360 | /* |
361 | * Target may require that it is never sent I/O larger than len. | ||
362 | */ | ||
363 | int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len); | ||
364 | |||
365 | /* | ||
361 | * Table reference counting. | 366 | * Table reference counting. |
362 | */ | 367 | */ |
363 | struct dm_table *dm_get_live_table(struct mapped_device *md); | 368 | struct dm_table *dm_get_live_table(struct mapped_device *md); |