• Home
  • Raw
  • Download

Lines Matching full:md

52 	struct mapped_device *md;  member
99 dm_get(hc->md); in __get_name_cell()
118 dm_get(hc->md); in __get_uuid_cell()
195 struct mapped_device *md; in __get_dev_cell() local
198 md = dm_get_md(huge_decode_dev(dev)); in __get_dev_cell()
199 if (!md) in __get_dev_cell()
202 hc = dm_get_mdptr(md); in __get_dev_cell()
204 dm_put(md); in __get_dev_cell()
217 struct mapped_device *md) in alloc_cell() argument
244 hc->md = md; in alloc_cell()
262 static int dm_hash_insert(const char *name, const char *uuid, struct mapped_device *md) in dm_hash_insert() argument
269 cell = alloc_cell(name, uuid, md); in dm_hash_insert()
279 dm_put(hc->md); in dm_hash_insert()
289 dm_put(hc->md); in dm_hash_insert()
294 dm_get(md); in dm_hash_insert()
296 dm_set_mdptr(md, cell); in dm_hash_insert()
319 dm_set_mdptr(hc->md, NULL); in __hash_remove()
322 table = dm_get_live_table(hc->md, &srcu_idx); in __hash_remove()
325 dm_put_live_table(hc->md, srcu_idx); in __hash_remove()
330 dm_put(hc->md); in __hash_remove()
341 struct mapped_device *md; in dm_hash_remove_all() local
351 md = hc->md; in dm_hash_remove_all()
352 dm_get(md); in dm_hash_remove_all()
355 dm_lock_for_deletion(md, mark_deferred, only_deferred)) { in dm_hash_remove_all()
356 dm_put(md); in dm_hash_remove_all()
366 dm_sync_table(md); in dm_hash_remove_all()
369 dm_ima_measure_on_device_remove(md, true); in dm_hash_remove_all()
370 dm_put(md); in dm_hash_remove_all()
372 dm_destroy(md); in dm_hash_remove_all()
374 dm_destroy_immediate(md); in dm_hash_remove_all()
432 struct mapped_device *md; in dm_hash_rename() local
457 dm_put(hc->md); in dm_hash_rename()
482 dm_put(hc->md); in dm_hash_rename()
496 table = dm_get_live_table(hc->md, &srcu_idx); in dm_hash_rename()
499 dm_put_live_table(hc->md, srcu_idx); in dm_hash_rename()
501 if (!dm_kobject_uevent(hc->md, KOBJ_CHANGE, param->event_nr, false)) in dm_hash_rename()
504 md = hc->md; in dm_hash_rename()
506 dm_ima_measure_on_device_rename(md); in dm_hash_rename()
511 return md; in dm_hash_rename()
640 disk = dm_disk(hc->md); in list_devices()
647 event_nr[0] = dm_get_event_nr(hc->md); in list_devices()
789 static struct dm_table *dm_get_inactive_table(struct mapped_device *md, int *srcu_idx) in dm_get_inactive_table() argument
795 dm_get_live_table(md, srcu_idx); in dm_get_inactive_table()
798 hc = dm_get_mdptr(md); in dm_get_inactive_table()
812 static struct dm_table *dm_get_live_or_inactive_table(struct mapped_device *md, in dm_get_live_or_inactive_table() argument
817 dm_get_inactive_table(md, srcu_idx) : dm_get_live_table(md, srcu_idx); in dm_get_live_or_inactive_table()
824 static void __dev_status(struct mapped_device *md, struct dm_ioctl *param) in __dev_status() argument
826 struct gendisk *disk = dm_disk(md); in __dev_status()
833 if (dm_suspended_md(md)) in __dev_status()
836 if (dm_suspended_internally_md(md)) in __dev_status()
839 if (dm_test_deferred_remove_flag(md)) in __dev_status()
849 param->open_count = dm_open_count(md); in __dev_status()
851 param->event_nr = dm_get_event_nr(md); in __dev_status()
854 table = dm_get_live_table(md, &srcu_idx); in __dev_status()
864 dm_put_live_table(md, srcu_idx); in __dev_status()
869 table = dm_get_inactive_table(md, &srcu_idx); in __dev_status()
875 dm_put_live_table(md, srcu_idx); in __dev_status()
882 struct mapped_device *md; in dev_create() local
891 r = dm_create(m, &md); in dev_create()
895 r = dm_hash_insert(param->name, *param->uuid ? param->uuid : NULL, md); in dev_create()
897 dm_put(md); in dev_create()
898 dm_destroy(md); in dev_create()
904 __dev_status(md, param); in dev_create()
906 dm_put(md); in dev_create()
966 struct mapped_device *md = NULL; in find_device() local
971 md = hc->md; in find_device()
974 return md; in find_device()
980 struct mapped_device *md; in dev_remove() local
993 md = hc->md; in dev_remove()
998 r = dm_lock_for_deletion(md, !!(param->flags & DM_DEFERRED_REMOVE), false); in dev_remove()
1002 dm_put(md); in dev_remove()
1007 dm_put(md); in dev_remove()
1015 dm_sync_table(md); in dev_remove()
1021 dm_ima_measure_on_device_remove(md, false); in dev_remove()
1023 if (!dm_kobject_uevent(md, KOBJ_REMOVE, param->event_nr, false)) in dev_remove()
1026 dm_put(md); in dev_remove()
1027 dm_destroy(md); in dev_remove()
1048 struct mapped_device *md; in dev_rename() local
1064 md = dm_hash_rename(param, new_data); in dev_rename()
1065 if (IS_ERR(md)) in dev_rename()
1066 return PTR_ERR(md); in dev_rename()
1068 __dev_status(md, param); in dev_rename()
1069 dm_put(md); in dev_rename()
1077 struct mapped_device *md; in dev_set_geometry() local
1083 md = find_device(param); in dev_set_geometry()
1084 if (!md) in dev_set_geometry()
1111 r = dm_set_geometry(md, &geometry); in dev_set_geometry()
1116 dm_put(md); in dev_set_geometry()
1124 struct mapped_device *md; in do_suspend() local
1126 md = find_device(param); in do_suspend()
1127 if (!md) in do_suspend()
1135 if (!dm_suspended_md(md)) { in do_suspend()
1136 r = dm_suspend(md, suspend_flags); in do_suspend()
1141 __dev_status(md, param); in do_suspend()
1144 dm_put(md); in do_suspend()
1154 struct mapped_device *md; in do_resume() local
1167 md = hc->md; in do_resume()
1184 if (!dm_suspended_md(md)) in do_resume()
1185 dm_suspend(md, suspend_flags); in do_resume()
1187 old_size = dm_get_size(md); in do_resume()
1188 old_map = dm_swap_table(md, new_map); in do_resume()
1190 dm_sync_table(md); in do_resume()
1192 dm_put(md); in do_resume()
1195 new_size = dm_get_size(md); in do_resume()
1200 set_disk_ro(dm_disk(md), 0); in do_resume()
1202 set_disk_ro(dm_disk(md), 1); in do_resume()
1205 if (dm_suspended_md(md)) { in do_resume()
1206 r = dm_resume(md); in do_resume()
1208 dm_ima_measure_on_device_resume(md, new_map ? true : false); in do_resume()
1210 if (!dm_kobject_uevent(md, KOBJ_CHANGE, param->event_nr, need_resize_uevent)) in do_resume()
1223 __dev_status(md, param); in do_resume()
1225 dm_put(md); in do_resume()
1247 struct mapped_device *md; in dev_status() local
1249 md = find_device(param); in dev_status()
1250 if (!md) in dev_status()
1253 __dev_status(md, param); in dev_status()
1254 dm_put(md); in dev_status()
1341 struct mapped_device *md; in dev_wait() local
1345 md = find_device(param); in dev_wait()
1346 if (!md) in dev_wait()
1352 if (dm_wait_event(md, param->event_nr)) { in dev_wait()
1362 __dev_status(md, param); in dev_wait()
1364 table = dm_get_live_or_inactive_table(md, param, &srcu_idx); in dev_wait()
1367 dm_put_live_table(md, srcu_idx); in dev_wait()
1370 dm_put(md); in dev_wait()
1501 struct mapped_device *md; in table_load() local
1504 md = find_device(param); in table_load()
1505 if (!md) in table_load()
1508 r = dm_table_create(&t, get_mode(param), param->target_count, md); in table_load()
1512 /* Protect md->type and md->queue against concurrent table loads. */ in table_load()
1513 dm_lock_md_type(md); in table_load()
1520 immutable_target_type = dm_get_immutable_target_type(md); in table_load()
1530 if (dm_get_md_type(md) == DM_TYPE_NONE) { in table_load()
1531 /* setup md->queue to reflect md's type (may block) */ in table_load()
1532 r = dm_setup_md_queue(md, t); in table_load()
1537 } else if (!is_valid_type(dm_get_md_type(md), dm_table_get_type(t))) { in table_load()
1539 dm_get_md_type(md), dm_table_get_type(t)); in table_load()
1544 dm_unlock_md_type(md); in table_load()
1548 hc = dm_get_mdptr(md); in table_load()
1562 __dev_status(md, param); in table_load()
1565 dm_sync_table(md); in table_load()
1569 dm_put(md); in table_load()
1574 dm_unlock_md_type(md); in table_load()
1578 dm_put(md); in table_load()
1586 struct mapped_device *md; in table_clear() local
1605 md = hc->md; in table_clear()
1609 __dev_status(md, param); in table_clear()
1612 dm_sync_table(md); in table_clear()
1615 dm_ima_measure_on_table_clear(md, has_new_map); in table_clear()
1616 dm_put(md); in table_clear()
1668 struct mapped_device *md; in table_deps() local
1672 md = find_device(param); in table_deps()
1673 if (!md) in table_deps()
1676 __dev_status(md, param); in table_deps()
1678 table = dm_get_live_or_inactive_table(md, param, &srcu_idx); in table_deps()
1681 dm_put_live_table(md, srcu_idx); in table_deps()
1683 dm_put(md); in table_deps()
1694 struct mapped_device *md; in table_status() local
1698 md = find_device(param); in table_status()
1699 if (!md) in table_status()
1702 __dev_status(md, param); in table_status()
1704 table = dm_get_live_or_inactive_table(md, param, &srcu_idx); in table_status()
1707 dm_put_live_table(md, srcu_idx); in table_status()
1709 dm_put(md); in table_status()
1720 static int message_for_md(struct mapped_device *md, unsigned int argc, char **argv, in message_for_md() argument
1733 return dm_cancel_deferred_remove(md); in message_for_md()
1736 r = dm_stats_message(md, argc, argv, result, maxlen); in message_for_md()
1751 struct mapped_device *md; in target_message() local
1759 md = find_device(param); in target_message()
1760 if (!md) in target_message()
1782 r = message_for_md(md, argc, argv, result, maxlen); in target_message()
1786 table = dm_get_live_table(md, &srcu_idx); in target_message()
1790 if (dm_deleting_md(md)) { in target_message()
1807 dm_put_live_table(md, srcu_idx); in target_message()
1812 __dev_status(md, param); in target_message()
1823 dm_put(md); in target_message()
2200 * @md: Pointer to mapped_device
2204 int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid) in dm_copy_name_and_uuid() argument
2209 if (!md) in dm_copy_name_and_uuid()
2213 hc = dm_get_mdptr(md); in dm_copy_name_and_uuid()
2254 struct mapped_device *md; in dm_early_create() local
2268 r = dm_create(m, &md); in dm_early_create()
2273 r = dm_hash_insert(dmi->name, *dmi->uuid ? dmi->uuid : NULL, md); in dm_early_create()
2278 r = dm_table_create(&t, get_mode(dmi), dmi->target_count, md); in dm_early_create()
2299 /* setup md->queue to reflect md's type (may block) */ in dm_early_create()
2300 r = dm_setup_md_queue(md, t); in dm_early_create()
2307 dm_suspend(md, 0); in dm_early_create()
2308 old_map = dm_swap_table(md, t); in dm_early_create()
2313 set_disk_ro(dm_disk(md), !!(dmi->flags & DM_READONLY_FLAG)); in dm_early_create()
2316 r = dm_resume(md); in dm_early_create()
2320 DMINFO("%s (%s) is ready", md->disk->disk_name, dmi->name); in dm_early_create()
2321 dm_put(md); in dm_early_create()
2331 dm_put(md); in dm_early_create()
2333 dm_put(md); in dm_early_create()
2334 dm_destroy(md); in dm_early_create()