diff options
Diffstat (limited to 'include/linux/device-mapper.h')
| -rw-r--r-- | include/linux/device-mapper.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index d4c9c0b88adc..2970022faa63 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -22,7 +22,7 @@ typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | |||
| 22 | union map_info { | 22 | union map_info { |
| 23 | void *ptr; | 23 | void *ptr; |
| 24 | unsigned long long ll; | 24 | unsigned long long ll; |
| 25 | unsigned flush_request; | 25 | unsigned target_request_nr; |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | /* | 28 | /* |
| @@ -118,10 +118,9 @@ struct dm_dev { | |||
| 118 | /* | 118 | /* |
| 119 | * Constructors should call these functions to ensure destination devices | 119 | * Constructors should call these functions to ensure destination devices |
| 120 | * are opened/closed correctly. | 120 | * are opened/closed correctly. |
| 121 | * FIXME: too many arguments. | ||
| 122 | */ | 121 | */ |
| 123 | int dm_get_device(struct dm_target *ti, const char *path, sector_t start, | 122 | int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, |
| 124 | sector_t len, fmode_t mode, struct dm_dev **result); | 123 | struct dm_dev **result); |
| 125 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); | 124 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); |
| 126 | 125 | ||
| 127 | /* | 126 | /* |
| @@ -175,12 +174,18 @@ struct dm_target { | |||
| 175 | * A number of zero-length barrier requests that will be submitted | 174 | * A number of zero-length barrier requests that will be submitted |
| 176 | * to the target for the purpose of flushing cache. | 175 | * to the target for the purpose of flushing cache. |
| 177 | * | 176 | * |
| 178 | * The request number will be placed in union map_info->flush_request. | 177 | * The request number will be placed in union map_info->target_request_nr. |
| 179 | * It is a responsibility of the target driver to remap these requests | 178 | * It is a responsibility of the target driver to remap these requests |
| 180 | * to the real underlying devices. | 179 | * to the real underlying devices. |
| 181 | */ | 180 | */ |
| 182 | unsigned num_flush_requests; | 181 | unsigned num_flush_requests; |
| 183 | 182 | ||
| 183 | /* | ||
| 184 | * The number of discard requests that will be submitted to the | ||
| 185 | * target. map_info->request_nr is used just like num_flush_requests. | ||
| 186 | */ | ||
| 187 | unsigned num_discard_requests; | ||
| 188 | |||
| 184 | /* target specific data */ | 189 | /* target specific data */ |
| 185 | void *private; | 190 | void *private; |
| 186 | 191 | ||
| @@ -393,6 +398,12 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
| 393 | #define dm_array_too_big(fixed, obj, num) \ | 398 | #define dm_array_too_big(fixed, obj, num) \ |
| 394 | ((num) > (UINT_MAX - (fixed)) / (obj)) | 399 | ((num) > (UINT_MAX - (fixed)) / (obj)) |
| 395 | 400 | ||
| 401 | /* | ||
| 402 | * Sector offset taken relative to the start of the target instead of | ||
| 403 | * relative to the start of the device. | ||
| 404 | */ | ||
| 405 | #define dm_target_offset(ti, sector) ((sector) - (ti)->begin) | ||
| 406 | |||
| 396 | static inline sector_t to_sector(unsigned long n) | 407 | static inline sector_t to_sector(unsigned long n) |
| 397 | { | 408 | { |
| 398 | return (n >> SECTOR_SHIFT); | 409 | return (n >> SECTOR_SHIFT); |
