diff options
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r-- | include/linux/device-mapper.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 4427e045405..99e3e50b5c5 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -197,6 +197,11 @@ struct dm_target { | |||
197 | * whether or not its underlying devices have support. | 197 | * whether or not its underlying devices have support. |
198 | */ | 198 | */ |
199 | unsigned discards_supported:1; | 199 | unsigned discards_supported:1; |
200 | |||
201 | /* | ||
202 | * Set if this target does not return zeroes on discarded blocks. | ||
203 | */ | ||
204 | unsigned discard_zeroes_data_unsupported:1; | ||
200 | }; | 205 | }; |
201 | 206 | ||
202 | /* Each target can link one of these into the table */ | 207 | /* Each target can link one of these into the table */ |
@@ -208,6 +213,49 @@ struct dm_target_callbacks { | |||
208 | int dm_register_target(struct target_type *t); | 213 | int dm_register_target(struct target_type *t); |
209 | void dm_unregister_target(struct target_type *t); | 214 | void dm_unregister_target(struct target_type *t); |
210 | 215 | ||
216 | /* | ||
217 | * Target argument parsing. | ||
218 | */ | ||
219 | struct dm_arg_set { | ||
220 | unsigned argc; | ||
221 | char **argv; | ||
222 | }; | ||
223 | |||
224 | /* | ||
225 | * The minimum and maximum value of a numeric argument, together with | ||
226 | * the error message to use if the number is found to be outside that range. | ||
227 | */ | ||
228 | struct dm_arg { | ||
229 | unsigned min; | ||
230 | unsigned max; | ||
231 | char *error; | ||
232 | }; | ||
233 | |||
234 | /* | ||
235 | * Validate the next argument, either returning it as *value or, if invalid, | ||
236 | * returning -EINVAL and setting *error. | ||
237 | */ | ||
238 | int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set, | ||
239 | unsigned *value, char **error); | ||
240 | |||
241 | /* | ||
242 | * Process the next argument as the start of a group containing between | ||
243 | * arg->min and arg->max further arguments. Either return the size as | ||
244 | * *num_args or, if invalid, return -EINVAL and set *error. | ||
245 | */ | ||
246 | int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set, | ||
247 | unsigned *num_args, char **error); | ||
248 | |||
249 | /* | ||
250 | * Return the current argument and shift to the next. | ||
251 | */ | ||
252 | const char *dm_shift_arg(struct dm_arg_set *as); | ||
253 | |||
254 | /* | ||
255 | * Move through num_args arguments. | ||
256 | */ | ||
257 | void dm_consume_args(struct dm_arg_set *as, unsigned num_args); | ||
258 | |||
211 | /*----------------------------------------------------------------- | 259 | /*----------------------------------------------------------------- |
212 | * Functions for creating and manipulating mapped devices. | 260 | * Functions for creating and manipulating mapped devices. |
213 | * Drop the reference with dm_put when you finish with the object. | 261 | * Drop the reference with dm_put when you finish with the object. |