2 * Copyright (C) 2001 Sistina Software (UK) Limited.
3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
5 * This file is released under the GPL.
10 #include <linux/module.h>
11 #include <linux/vmalloc.h>
12 #include <linux/blkdev.h>
13 #include <linux/namei.h>
14 #include <linux/ctype.h>
15 #include <linux/slab.h>
16 #include <linux/interrupt.h>
17 #include <linux/mutex.h>
18 #include <linux/delay.h>
19 #include <asm/atomic.h>
21 #define DM_MSG_PREFIX "table"
24 #define NODE_SIZE L1_CACHE_BYTES
25 #define KEYS_PER_NODE (NODE_SIZE / sizeof(sector_t))
26 #define CHILDREN_PER_NODE (KEYS_PER_NODE + 1)
29 * The table has always exactly one reference from either mapped_device->map
30 * or hash_cell->new_map. This reference is not counted in table->holders.
31 * A pair of dm_create_table/dm_destroy_table functions is used for table
32 * creation/destruction.
34 * Temporary references from the other code increase table->holders. A pair
35 * of dm_table_get/dm_table_put functions is used to manipulate it.
37 * When the table is about to be destroyed, we wait for table->holders to
42 struct mapped_device *md;
47 unsigned int counts[MAX_DEPTH]; /* in nodes */
48 sector_t *index[MAX_DEPTH];
50 unsigned int num_targets;
51 unsigned int num_allocated;
53 struct dm_target *targets;
56 * Indicates the rw permissions for the new logical
57 * device. This should be a combination of FMODE_READ
62 /* a list of devices used by this table */
63 struct list_head devices;
66 * These are optimistic limits taken from all the
67 * targets, some targets will need smaller limits.
69 struct queue_limits limits;
71 /* events get handed up using this callback */
72 void (*event_fn)(void *);
77 * Similar to ceiling(log_size(n))
79 static unsigned int int_log(unsigned int n, unsigned int base)
84 n = dm_div_up(n, base);
92 * Calculate the index of the child node of the n'th node k'th key.
94 static inline unsigned int get_child(unsigned int n, unsigned int k)
96 return (n * CHILDREN_PER_NODE) + k;
100 * Return the n'th node of level l from table t.
102 static inline sector_t *get_node(struct dm_table *t,
103 unsigned int l, unsigned int n)
105 return t->index[l] + (n * KEYS_PER_NODE);
109 * Return the highest key that you could lookup from the n'th
110 * node on level l of the btree.
112 static sector_t high(struct dm_table *t, unsigned int l, unsigned int n)
114 for (; l < t->depth - 1; l++)
115 n = get_child(n, CHILDREN_PER_NODE - 1);
117 if (n >= t->counts[l])
118 return (sector_t) - 1;
120 return get_node(t, l, n)[KEYS_PER_NODE - 1];
124 * Fills in a level of the btree based on the highs of the level
127 static int setup_btree_index(unsigned int l, struct dm_table *t)
132 for (n = 0U; n < t->counts[l]; n++) {
133 node = get_node(t, l, n);
135 for (k = 0U; k < KEYS_PER_NODE; k++)
136 node[k] = high(t, l + 1, get_child(n, k));
142 void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size)
148 * Check that we're not going to overflow.
150 if (nmemb > (ULONG_MAX / elem_size))
153 size = nmemb * elem_size;
154 addr = vmalloc(size);
156 memset(addr, 0, size);
162 * highs, and targets are managed as dynamic arrays during a
165 static int alloc_targets(struct dm_table *t, unsigned int num)
168 struct dm_target *n_targets;
169 int n = t->num_targets;
172 * Allocate both the target array and offset array at once.
173 * Append an empty entry to catch sectors beyond the end of
176 n_highs = (sector_t *) dm_vcalloc(num + 1, sizeof(struct dm_target) +
181 n_targets = (struct dm_target *) (n_highs + num);
184 memcpy(n_highs, t->highs, sizeof(*n_highs) * n);
185 memcpy(n_targets, t->targets, sizeof(*n_targets) * n);
188 memset(n_highs + n, -1, sizeof(*n_highs) * (num - n));
191 t->num_allocated = num;
193 t->targets = n_targets;
198 int dm_table_create(struct dm_table **result, fmode_t mode,
199 unsigned num_targets, struct mapped_device *md)
201 struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL);
206 INIT_LIST_HEAD(&t->devices);
207 atomic_set(&t->holders, 0);
210 num_targets = KEYS_PER_NODE;
212 num_targets = dm_round_up(num_targets, KEYS_PER_NODE);
214 if (alloc_targets(t, num_targets)) {
226 static void free_devices(struct list_head *devices)
228 struct list_head *tmp, *next;
230 list_for_each_safe(tmp, next, devices) {
231 struct dm_dev_internal *dd =
232 list_entry(tmp, struct dm_dev_internal, list);
233 DMWARN("dm_table_destroy: dm_put_device call missing for %s",
239 void dm_table_destroy(struct dm_table *t)
243 while (atomic_read(&t->holders))
247 /* free the indexes (see dm_table_complete) */
249 vfree(t->index[t->depth - 2]);
251 /* free the targets */
252 for (i = 0; i < t->num_targets; i++) {
253 struct dm_target *tgt = t->targets + i;
258 dm_put_target_type(tgt->type);
263 /* free the device list */
264 if (t->devices.next != &t->devices)
265 free_devices(&t->devices);
270 void dm_table_get(struct dm_table *t)
272 atomic_inc(&t->holders);
275 void dm_table_put(struct dm_table *t)
280 smp_mb__before_atomic_dec();
281 atomic_dec(&t->holders);
285 * Checks to see if we need to extend highs or targets.
287 static inline int check_space(struct dm_table *t)
289 if (t->num_targets >= t->num_allocated)
290 return alloc_targets(t, t->num_allocated * 2);
296 * See if we've already got a device in the list.
298 static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev)
300 struct dm_dev_internal *dd;
302 list_for_each_entry (dd, l, list)
303 if (dd->dm_dev.bdev->bd_dev == dev)
310 * Open a device so we can use it as a map destination.
312 static int open_dev(struct dm_dev_internal *d, dev_t dev,
313 struct mapped_device *md)
315 static char *_claim_ptr = "I belong to device-mapper";
316 struct block_device *bdev;
320 BUG_ON(d->dm_dev.bdev);
322 bdev = open_by_devnum(dev, d->dm_dev.mode);
324 return PTR_ERR(bdev);
325 r = bd_claim_by_disk(bdev, _claim_ptr, dm_disk(md));
327 blkdev_put(bdev, d->dm_dev.mode);
329 d->dm_dev.bdev = bdev;
334 * Close a device that we've been using.
336 static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
341 bd_release_from_disk(d->dm_dev.bdev, dm_disk(md));
342 blkdev_put(d->dm_dev.bdev, d->dm_dev.mode);
343 d->dm_dev.bdev = NULL;
347 * If possible, this checks an area of a destination device is valid.
349 static int device_area_is_valid(struct dm_target *ti, struct block_device *bdev,
350 sector_t start, sector_t len)
352 sector_t dev_size = i_size_read(bdev->bd_inode) >> SECTOR_SHIFT;
353 unsigned short logical_block_size_sectors =
354 ti->limits.logical_block_size >> SECTOR_SHIFT;
355 char b[BDEVNAME_SIZE];
360 if ((start >= dev_size) || (start + len > dev_size)) {
361 DMWARN("%s: %s too small for target",
362 dm_device_name(ti->table->md), bdevname(bdev, b));
366 if (logical_block_size_sectors <= 1)
369 if (start & (logical_block_size_sectors - 1)) {
370 DMWARN("%s: start=%llu not aligned to h/w "
371 "logical block size %hu of %s",
372 dm_device_name(ti->table->md),
373 (unsigned long long)start,
374 ti->limits.logical_block_size, bdevname(bdev, b));
378 if (len & (logical_block_size_sectors - 1)) {
379 DMWARN("%s: len=%llu not aligned to h/w "
380 "logical block size %hu of %s",
381 dm_device_name(ti->table->md),
382 (unsigned long long)len,
383 ti->limits.logical_block_size, bdevname(bdev, b));
391 * This upgrades the mode on an already open dm_dev, being
392 * careful to leave things as they were if we fail to reopen the
393 * device and not to touch the existing bdev field in case
394 * it is accessed concurrently inside dm_table_any_congested().
396 static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode,
397 struct mapped_device *md)
400 struct dm_dev_internal dd_new, dd_old;
402 dd_new = dd_old = *dd;
404 dd_new.dm_dev.mode |= new_mode;
405 dd_new.dm_dev.bdev = NULL;
407 r = open_dev(&dd_new, dd->dm_dev.bdev->bd_dev, md);
411 dd->dm_dev.mode |= new_mode;
412 close_dev(&dd_old, md);
418 * Add a device to the list, or just increment the usage count if
419 * it's already present.
421 static int __table_get_device(struct dm_table *t, struct dm_target *ti,
422 const char *path, sector_t start, sector_t len,
423 fmode_t mode, struct dm_dev **result)
426 dev_t uninitialized_var(dev);
427 struct dm_dev_internal *dd;
428 unsigned int major, minor;
432 if (sscanf(path, "%u:%u", &major, &minor) == 2) {
433 /* Extract the major/minor numbers */
434 dev = MKDEV(major, minor);
435 if (MAJOR(dev) != major || MINOR(dev) != minor)
438 /* convert the path to a device */
439 struct block_device *bdev = lookup_bdev(path);
442 return PTR_ERR(bdev);
447 dd = find_device(&t->devices, dev);
449 dd = kmalloc(sizeof(*dd), GFP_KERNEL);
453 dd->dm_dev.mode = mode;
454 dd->dm_dev.bdev = NULL;
456 if ((r = open_dev(dd, dev, t->md))) {
461 format_dev_t(dd->dm_dev.name, dev);
463 atomic_set(&dd->count, 0);
464 list_add(&dd->list, &t->devices);
466 } else if (dd->dm_dev.mode != (mode | dd->dm_dev.mode)) {
467 r = upgrade_mode(dd, mode, t->md);
471 atomic_inc(&dd->count);
473 *result = &dd->dm_dev;
478 * Returns the minimum that is _not_ zero, unless both are zero.
480 #define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
482 void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev)
484 struct request_queue *q = bdev_get_queue(bdev);
485 char b[BDEVNAME_SIZE];
488 DMWARN("%s: Cannot set limits for nonexistent device %s",
489 dm_device_name(ti->table->md), bdevname(bdev, b));
493 if (blk_stack_limits(&ti->limits, &q->limits, 0) < 0)
494 DMWARN("%s: target device %s is misaligned",
495 dm_device_name(ti->table->md), bdevname(bdev, b));
498 * Check if merge fn is supported.
499 * If not we'll force DM to use PAGE_SIZE or
500 * smaller I/O, just to be safe.
503 if (q->merge_bvec_fn && !ti->type->merge)
504 ti->limits.max_sectors =
505 min_not_zero(ti->limits.max_sectors,
506 (unsigned int) (PAGE_SIZE >> 9));
508 EXPORT_SYMBOL_GPL(dm_set_device_limits);
510 int dm_get_device(struct dm_target *ti, const char *path, sector_t start,
511 sector_t len, fmode_t mode, struct dm_dev **result)
513 int r = __table_get_device(ti->table, ti, path,
514 start, len, mode, result);
519 dm_set_device_limits(ti, (*result)->bdev);
521 if (!device_area_is_valid(ti, (*result)->bdev, start, len)) {
522 dm_put_device(ti, *result);
531 * Decrement a devices use count and remove it if necessary.
533 void dm_put_device(struct dm_target *ti, struct dm_dev *d)
535 struct dm_dev_internal *dd = container_of(d, struct dm_dev_internal,
538 if (atomic_dec_and_test(&dd->count)) {
539 close_dev(dd, ti->table->md);
546 * Checks to see if the target joins onto the end of the table.
548 static int adjoin(struct dm_table *table, struct dm_target *ti)
550 struct dm_target *prev;
552 if (!table->num_targets)
555 prev = &table->targets[table->num_targets - 1];
556 return (ti->begin == (prev->begin + prev->len));
560 * Used to dynamically allocate the arg array.
562 static char **realloc_argv(unsigned *array_size, char **old_argv)
567 new_size = *array_size ? *array_size * 2 : 64;
568 argv = kmalloc(new_size * sizeof(*argv), GFP_KERNEL);
570 memcpy(argv, old_argv, *array_size * sizeof(*argv));
571 *array_size = new_size;
579 * Destructively splits up the argument list to pass to ctr.
581 int dm_split_args(int *argc, char ***argvp, char *input)
583 char *start, *end = input, *out, **argv = NULL;
584 unsigned array_size = 0;
593 argv = realloc_argv(&array_size, argv);
600 /* Skip whitespace */
601 while (*start && isspace(*start))
605 break; /* success, we hit the end */
607 /* 'out' is used to remove any back-quotes */
610 /* Everything apart from '\0' can be quoted */
611 if (*end == '\\' && *(end + 1)) {
618 break; /* end of token */
623 /* have we already filled the array ? */
624 if ((*argc + 1) > array_size) {
625 argv = realloc_argv(&array_size, argv);
630 /* we know this is whitespace */
634 /* terminate the string and put it in the array */
644 static void init_valid_queue_limits(struct queue_limits *limits)
646 if (!limits->max_sectors)
647 limits->max_sectors = SAFE_MAX_SECTORS;
648 if (!limits->max_hw_sectors)
649 limits->max_hw_sectors = SAFE_MAX_SECTORS;
650 if (!limits->max_phys_segments)
651 limits->max_phys_segments = MAX_PHYS_SEGMENTS;
652 if (!limits->max_hw_segments)
653 limits->max_hw_segments = MAX_HW_SEGMENTS;
654 if (!limits->logical_block_size)
655 limits->logical_block_size = 1 << SECTOR_SHIFT;
656 if (!limits->physical_block_size)
657 limits->physical_block_size = 1 << SECTOR_SHIFT;
659 limits->io_min = 1 << SECTOR_SHIFT;
660 if (!limits->max_segment_size)
661 limits->max_segment_size = MAX_SEGMENT_SIZE;
662 if (!limits->seg_boundary_mask)
663 limits->seg_boundary_mask = BLK_SEG_BOUNDARY_MASK;
664 if (!limits->bounce_pfn)
665 limits->bounce_pfn = -1;
667 * The other fields (alignment_offset, io_opt, misaligned)
668 * hold 0 from the kzalloc().
673 * Impose necessary and sufficient conditions on a devices's table such
674 * that any incoming bio which respects its logical_block_size can be
675 * processed successfully. If it falls across the boundary between
676 * two or more targets, the size of each piece it gets split into must
677 * be compatible with the logical_block_size of the target processing it.
679 static int validate_hardware_logical_block_alignment(struct dm_table *table)
682 * This function uses arithmetic modulo the logical_block_size
683 * (in units of 512-byte sectors).
685 unsigned short device_logical_block_size_sects =
686 table->limits.logical_block_size >> SECTOR_SHIFT;
689 * Offset of the start of the next table entry, mod logical_block_size.
691 unsigned short next_target_start = 0;
694 * Given an aligned bio that extends beyond the end of a
695 * target, how many sectors must the next target handle?
697 unsigned short remaining = 0;
699 struct dm_target *uninitialized_var(ti);
703 * Check each entry in the table in turn.
705 while (i < dm_table_get_num_targets(table)) {
706 ti = dm_table_get_target(table, i++);
709 * If the remaining sectors fall entirely within this
710 * table entry are they compatible with its logical_block_size?
712 if (remaining < ti->len &&
713 remaining & ((ti->limits.logical_block_size >>
718 (unsigned short) ((next_target_start + ti->len) &
719 (device_logical_block_size_sects - 1));
720 remaining = next_target_start ?
721 device_logical_block_size_sects - next_target_start : 0;
725 DMWARN("%s: table line %u (start sect %llu len %llu) "
726 "not aligned to hardware logical block size %hu",
727 dm_device_name(table->md), i,
728 (unsigned long long) ti->begin,
729 (unsigned long long) ti->len,
730 table->limits.logical_block_size);
737 int dm_table_add_target(struct dm_table *t, const char *type,
738 sector_t start, sector_t len, char *params)
740 int r = -EINVAL, argc;
742 struct dm_target *tgt;
744 if ((r = check_space(t)))
747 tgt = t->targets + t->num_targets;
748 memset(tgt, 0, sizeof(*tgt));
751 DMERR("%s: zero-length target", dm_device_name(t->md));
755 tgt->type = dm_get_target_type(type);
757 DMERR("%s: %s: unknown target type", dm_device_name(t->md),
765 tgt->error = "Unknown error";
768 * Does this target adjoin the previous one ?
770 if (!adjoin(t, tgt)) {
771 tgt->error = "Gap in table";
776 r = dm_split_args(&argc, &argv, params);
778 tgt->error = "couldn't split parameters (insufficient memory)";
782 r = tgt->type->ctr(tgt, argc, argv);
787 t->highs[t->num_targets++] = tgt->begin + tgt->len - 1;
789 if (blk_stack_limits(&t->limits, &tgt->limits, 0) < 0)
790 DMWARN("%s: target device (start sect %llu len %llu) "
792 dm_device_name(t->md),
793 (unsigned long long) tgt->begin,
794 (unsigned long long) tgt->len);
798 DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error);
799 dm_put_target_type(tgt->type);
803 static int setup_indexes(struct dm_table *t)
806 unsigned int total = 0;
809 /* allocate the space for *all* the indexes */
810 for (i = t->depth - 2; i >= 0; i--) {
811 t->counts[i] = dm_div_up(t->counts[i + 1], CHILDREN_PER_NODE);
812 total += t->counts[i];
815 indexes = (sector_t *) dm_vcalloc(total, (unsigned long) NODE_SIZE);
819 /* set up internal nodes, bottom-up */
820 for (i = t->depth - 2; i >= 0; i--) {
821 t->index[i] = indexes;
822 indexes += (KEYS_PER_NODE * t->counts[i]);
823 setup_btree_index(i, t);
830 * Builds the btree to index the map.
832 int dm_table_complete(struct dm_table *t)
835 unsigned int leaf_nodes;
837 init_valid_queue_limits(&t->limits);
839 r = validate_hardware_logical_block_alignment(t);
843 /* how many indexes will the btree have ? */
844 leaf_nodes = dm_div_up(t->num_targets, KEYS_PER_NODE);
845 t->depth = 1 + int_log(leaf_nodes, CHILDREN_PER_NODE);
847 /* leaf layer has already been set up */
848 t->counts[t->depth - 1] = leaf_nodes;
849 t->index[t->depth - 1] = t->highs;
852 r = setup_indexes(t);
857 static DEFINE_MUTEX(_event_lock);
858 void dm_table_event_callback(struct dm_table *t,
859 void (*fn)(void *), void *context)
861 mutex_lock(&_event_lock);
863 t->event_context = context;
864 mutex_unlock(&_event_lock);
867 void dm_table_event(struct dm_table *t)
870 * You can no longer call dm_table_event() from interrupt
871 * context, use a bottom half instead.
873 BUG_ON(in_interrupt());
875 mutex_lock(&_event_lock);
877 t->event_fn(t->event_context);
878 mutex_unlock(&_event_lock);
881 sector_t dm_table_get_size(struct dm_table *t)
883 return t->num_targets ? (t->highs[t->num_targets - 1] + 1) : 0;
886 struct dm_target *dm_table_get_target(struct dm_table *t, unsigned int index)
888 if (index >= t->num_targets)
891 return t->targets + index;
895 * Search the btree for the correct target.
897 * Caller should check returned pointer with dm_target_is_valid()
898 * to trap I/O beyond end of device.
900 struct dm_target *dm_table_find_target(struct dm_table *t, sector_t sector)
902 unsigned int l, n = 0, k = 0;
905 for (l = 0; l < t->depth; l++) {
907 node = get_node(t, l, n);
909 for (k = 0; k < KEYS_PER_NODE; k++)
910 if (node[k] >= sector)
914 return &t->targets[(KEYS_PER_NODE * n) + k];
918 * Set the integrity profile for this device if all devices used have
921 static void dm_table_set_integrity(struct dm_table *t)
923 struct list_head *devices = dm_table_get_devices(t);
924 struct dm_dev_internal *prev = NULL, *dd = NULL;
926 if (!blk_get_integrity(dm_disk(t->md)))
929 list_for_each_entry(dd, devices, list) {
931 blk_integrity_compare(prev->dm_dev.bdev->bd_disk,
932 dd->dm_dev.bdev->bd_disk) < 0) {
933 DMWARN("%s: integrity not set: %s and %s mismatch",
934 dm_device_name(t->md),
935 prev->dm_dev.bdev->bd_disk->disk_name,
936 dd->dm_dev.bdev->bd_disk->disk_name);
942 if (!prev || !bdev_get_integrity(prev->dm_dev.bdev))
945 blk_integrity_register(dm_disk(t->md),
946 bdev_get_integrity(prev->dm_dev.bdev));
951 blk_integrity_register(dm_disk(t->md), NULL);
956 void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
959 * Make sure we obey the optimistic sub devices
962 blk_queue_max_sectors(q, t->limits.max_sectors);
963 blk_queue_max_phys_segments(q, t->limits.max_phys_segments);
964 blk_queue_max_hw_segments(q, t->limits.max_hw_segments);
965 blk_queue_logical_block_size(q, t->limits.logical_block_size);
966 blk_queue_max_segment_size(q, t->limits.max_segment_size);
967 blk_queue_max_hw_sectors(q, t->limits.max_hw_sectors);
968 blk_queue_segment_boundary(q, t->limits.seg_boundary_mask);
969 blk_queue_bounce_limit(q, t->limits.bounce_pfn);
971 if (t->limits.no_cluster)
972 queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);
974 queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q);
976 dm_table_set_integrity(t);
979 unsigned int dm_table_get_num_targets(struct dm_table *t)
981 return t->num_targets;
984 struct list_head *dm_table_get_devices(struct dm_table *t)
989 fmode_t dm_table_get_mode(struct dm_table *t)
994 static void suspend_targets(struct dm_table *t, unsigned postsuspend)
996 int i = t->num_targets;
997 struct dm_target *ti = t->targets;
1001 if (ti->type->postsuspend)
1002 ti->type->postsuspend(ti);
1003 } else if (ti->type->presuspend)
1004 ti->type->presuspend(ti);
1010 void dm_table_presuspend_targets(struct dm_table *t)
1015 suspend_targets(t, 0);
1018 void dm_table_postsuspend_targets(struct dm_table *t)
1023 suspend_targets(t, 1);
1026 int dm_table_resume_targets(struct dm_table *t)
1030 for (i = 0; i < t->num_targets; i++) {
1031 struct dm_target *ti = t->targets + i;
1033 if (!ti->type->preresume)
1036 r = ti->type->preresume(ti);
1041 for (i = 0; i < t->num_targets; i++) {
1042 struct dm_target *ti = t->targets + i;
1044 if (ti->type->resume)
1045 ti->type->resume(ti);
1051 int dm_table_any_congested(struct dm_table *t, int bdi_bits)
1053 struct dm_dev_internal *dd;
1054 struct list_head *devices = dm_table_get_devices(t);
1057 list_for_each_entry(dd, devices, list) {
1058 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev);
1059 char b[BDEVNAME_SIZE];
1062 r |= bdi_congested(&q->backing_dev_info, bdi_bits);
1064 DMWARN_LIMIT("%s: any_congested: nonexistent device %s",
1065 dm_device_name(t->md),
1066 bdevname(dd->dm_dev.bdev, b));
1072 void dm_table_unplug_all(struct dm_table *t)
1074 struct dm_dev_internal *dd;
1075 struct list_head *devices = dm_table_get_devices(t);
1077 list_for_each_entry(dd, devices, list) {
1078 struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev);
1079 char b[BDEVNAME_SIZE];
1084 DMWARN_LIMIT("%s: Cannot unplug nonexistent device %s",
1085 dm_device_name(t->md),
1086 bdevname(dd->dm_dev.bdev, b));
1090 struct mapped_device *dm_table_get_md(struct dm_table *t)
1097 EXPORT_SYMBOL(dm_vcalloc);
1098 EXPORT_SYMBOL(dm_get_device);
1099 EXPORT_SYMBOL(dm_put_device);
1100 EXPORT_SYMBOL(dm_table_event);
1101 EXPORT_SYMBOL(dm_table_get_size);
1102 EXPORT_SYMBOL(dm_table_get_mode);
1103 EXPORT_SYMBOL(dm_table_get_md);
1104 EXPORT_SYMBOL(dm_table_put);
1105 EXPORT_SYMBOL(dm_table_get);
1106 EXPORT_SYMBOL(dm_table_unplug_all);