Go to the documentation of this file.
8 #ifndef _LINUX_DEVICE_MAPPER_H
9 #define _LINUX_DEVICE_MAPPER_H
25 unsigned long long ll;
34 unsigned int argc,
char **argv);
63 struct bio *bio,
int error,
75 unsigned status_flags,
char *
result,
unsigned maxlen);
83 struct bio_vec *biovec,
int max_size);
95 struct queue_limits *limits);
164 #define DM_TARGET_SINGLETON 0x00000001
165 #define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON)
170 #define DM_TARGET_ALWAYS_WRITEABLE 0x00000002
171 #define dm_target_always_writeable(type) \
172 ((type)->features & DM_TARGET_ALWAYS_WRITEABLE)
178 #define DM_TARGET_IMMUTABLE 0x00000004
179 #define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE)
278 unsigned *num_args,
char **
error);
298 #define DM_ANY_MINOR (-1)
407 void *
dm_vcalloc(
unsigned long nmemb,
unsigned long elem_size);
412 #define DM_NAME "device-mapper"
417 #define dm_ratelimit() __ratelimit(&dm_ratelimit_state)
419 #define dm_ratelimit() 0
422 #define DMCRIT(f, arg...) \
423 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
425 #define DMERR(f, arg...) \
426 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
427 #define DMERR_LIMIT(f, arg...) \
429 if (dm_ratelimit()) \
430 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \
434 #define DMWARN(f, arg...) \
435 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
436 #define DMWARN_LIMIT(f, arg...) \
438 if (dm_ratelimit()) \
439 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \
443 #define DMINFO(f, arg...) \
444 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
445 #define DMINFO_LIMIT(f, arg...) \
447 if (dm_ratelimit()) \
448 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \
452 #ifdef CONFIG_DM_DEBUG
453 # define DMDEBUG(f, arg...) \
454 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
455 # define DMDEBUG_LIMIT(f, arg...) \
457 if (dm_ratelimit()) \
458 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \
462 # define DMDEBUG(f, arg...) do {} while (0)
463 # define DMDEBUG_LIMIT(f, arg...) do {} while (0)
466 #define DMEMIT(x...) sz += ((sz >= maxlen) ? \
467 0 : scnprintf(result + sz, maxlen - sz, x))
469 #define SECTOR_SHIFT 9
474 #define DM_ENDIO_INCOMPLETE 1
475 #define DM_ENDIO_REQUEUE 2
480 #define DM_MAPIO_SUBMITTED 0
481 #define DM_MAPIO_REMAPPED 1
482 #define DM_MAPIO_REQUEUE DM_ENDIO_REQUEUE
487 #define dm_div_up(n, sz) (((n) + (sz) - 1) / (sz))
489 #define dm_sector_div_up(n, sz) ( \
491 sector_t _r = ((n) + (sz) - 1); \
492 sector_div(_r, (sz)); \
500 #define dm_round_up(n, sz) (dm_div_up((n), (sz)) * (sz))
502 #define dm_array_too_big(fixed, obj, num) \
503 ((num) > (UINT_MAX - (fixed)) / (obj))
509 #define dm_target_offset(ti, sector) ((sector) - (ti)->begin)
511 static inline sector_t to_sector(
unsigned long n)
516 static inline unsigned long to_bytes(
sector_t n)