diff options
Diffstat (limited to 'include/linux/device-mapper.h')
| -rw-r--r-- | include/linux/device-mapper.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 98f34b886f95..38d27a10aa5d 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -66,14 +66,13 @@ typedef int (*dm_request_endio_fn) (struct dm_target *ti, | |||
| 66 | struct request *clone, int error, | 66 | struct request *clone, int error, |
| 67 | union map_info *map_context); | 67 | union map_info *map_context); |
| 68 | 68 | ||
| 69 | typedef void (*dm_flush_fn) (struct dm_target *ti); | ||
| 70 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); | 69 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); |
| 71 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); | 70 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); |
| 72 | typedef int (*dm_preresume_fn) (struct dm_target *ti); | 71 | typedef int (*dm_preresume_fn) (struct dm_target *ti); |
| 73 | typedef void (*dm_resume_fn) (struct dm_target *ti); | 72 | typedef void (*dm_resume_fn) (struct dm_target *ti); |
| 74 | 73 | ||
| 75 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | 74 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, |
| 76 | char *result, unsigned int maxlen); | 75 | unsigned status_flags, char *result, unsigned maxlen); |
| 77 | 76 | ||
| 78 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); | 77 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); |
| 79 | 78 | ||
| @@ -139,7 +138,6 @@ struct target_type { | |||
| 139 | dm_map_request_fn map_rq; | 138 | dm_map_request_fn map_rq; |
| 140 | dm_endio_fn end_io; | 139 | dm_endio_fn end_io; |
| 141 | dm_request_endio_fn rq_end_io; | 140 | dm_request_endio_fn rq_end_io; |
| 142 | dm_flush_fn flush; | ||
| 143 | dm_presuspend_fn presuspend; | 141 | dm_presuspend_fn presuspend; |
| 144 | dm_postsuspend_fn postsuspend; | 142 | dm_postsuspend_fn postsuspend; |
| 145 | dm_preresume_fn preresume; | 143 | dm_preresume_fn preresume; |
| @@ -188,8 +186,8 @@ struct dm_target { | |||
| 188 | sector_t begin; | 186 | sector_t begin; |
| 189 | sector_t len; | 187 | sector_t len; |
| 190 | 188 | ||
| 191 | /* Always a power of 2 */ | 189 | /* If non-zero, maximum size of I/O submitted to a target. */ |
| 192 | sector_t split_io; | 190 | uint32_t max_io_len; |
| 193 | 191 | ||
| 194 | /* | 192 | /* |
| 195 | * A number of zero-length barrier requests that will be submitted | 193 | * A number of zero-length barrier requests that will be submitted |
| @@ -214,15 +212,27 @@ struct dm_target { | |||
| 214 | char *error; | 212 | char *error; |
| 215 | 213 | ||
| 216 | /* | 214 | /* |
| 215 | * Set if this target needs to receive flushes regardless of | ||
| 216 | * whether or not its underlying devices have support. | ||
| 217 | */ | ||
| 218 | bool flush_supported:1; | ||
| 219 | |||
| 220 | /* | ||
| 217 | * Set if this target needs to receive discards regardless of | 221 | * Set if this target needs to receive discards regardless of |
| 218 | * whether or not its underlying devices have support. | 222 | * whether or not its underlying devices have support. |
| 219 | */ | 223 | */ |
| 220 | unsigned discards_supported:1; | 224 | bool discards_supported:1; |
| 225 | |||
| 226 | /* | ||
| 227 | * Set if the target required discard request to be split | ||
| 228 | * on max_io_len boundary. | ||
| 229 | */ | ||
| 230 | bool split_discard_requests:1; | ||
| 221 | 231 | ||
| 222 | /* | 232 | /* |
| 223 | * Set if this target does not return zeroes on discarded blocks. | 233 | * Set if this target does not return zeroes on discarded blocks. |
| 224 | */ | 234 | */ |
| 225 | unsigned discard_zeroes_data_unsupported:1; | 235 | bool discard_zeroes_data_unsupported:1; |
| 226 | }; | 236 | }; |
| 227 | 237 | ||
| 228 | /* Each target can link one of these into the table */ | 238 | /* Each target can link one of these into the table */ |
| @@ -360,6 +370,11 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback | |||
| 360 | int dm_table_complete(struct dm_table *t); | 370 | int dm_table_complete(struct dm_table *t); |
| 361 | 371 | ||
| 362 | /* | 372 | /* |
| 373 | * Target may require that it is never sent I/O larger than len. | ||
| 374 | */ | ||
| 375 | int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len); | ||
| 376 | |||
| 377 | /* | ||
| 363 | * Table reference counting. | 378 | * Table reference counting. |
| 364 | */ | 379 | */ |
| 365 | struct dm_table *dm_get_live_table(struct mapped_device *md); | 380 | struct dm_table *dm_get_live_table(struct mapped_device *md); |
