Lines Matching full:pe
747 struct dm_snap_pending_exception *pe = mempool_alloc(&s->pending_pool, in alloc_pending_exception() local
751 pe->snap = s; in alloc_pending_exception()
753 return pe; in alloc_pending_exception()
756 static void free_pending_exception(struct dm_snap_pending_exception *pe) in free_pending_exception() argument
758 struct dm_snapshot *s = pe->snap; in free_pending_exception()
760 mempool_free(pe, &s->pending_pool); in free_pending_exception()
1636 struct dm_snap_pending_exception *pe = context; in pending_complete() local
1638 struct dm_snapshot *s = pe->snap; in pending_complete()
1645 dm_exception_table_lock_init(s, pe->e.old_chunk, &lock); in pending_complete()
1664 *e = pe->e; in pending_complete()
1687 if (__chunk_is_tracked(s, pe->e.old_chunk)) { in pending_complete()
1689 __check_for_conflicting_io(s, pe->e.old_chunk); in pending_complete()
1695 dm_remove_exception(&pe->e); in pending_complete()
1699 snapshot_bios = bio_list_get(&pe->snapshot_bios); in pending_complete()
1700 origin_bios = bio_list_get(&pe->origin_bios); in pending_complete()
1701 full_bio = pe->full_bio; in pending_complete()
1703 full_bio->bi_end_io = pe->full_bio_end_io; in pending_complete()
1719 free_pending_exception(pe); in pending_complete()
1722 static void complete_exception(struct dm_snap_pending_exception *pe) in complete_exception() argument
1724 struct dm_snapshot *s = pe->snap; in complete_exception()
1727 s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error, in complete_exception()
1728 pending_complete, pe); in complete_exception()
1737 struct dm_snap_pending_exception *pe = context; in copy_callback() local
1738 struct dm_snapshot *s = pe->snap; in copy_callback()
1740 pe->copy_error = read_err || write_err; in copy_callback()
1742 if (pe->exception_sequence == s->exception_complete_sequence) { in copy_callback()
1746 complete_exception(pe); in copy_callback()
1750 pe = rb_entry(next, struct dm_snap_pending_exception, in copy_callback()
1752 if (pe->exception_sequence != s->exception_complete_sequence) in copy_callback()
1756 rb_erase(&pe->out_of_order_node, &s->out_of_order_tree); in copy_callback()
1757 complete_exception(pe); in copy_callback()
1769 BUG_ON(pe->exception_sequence == pe2->exception_sequence); in copy_callback()
1770 if (pe->exception_sequence < pe2->exception_sequence) in copy_callback()
1776 rb_link_node(&pe->out_of_order_node, parent, p); in copy_callback()
1777 rb_insert_color(&pe->out_of_order_node, &s->out_of_order_tree); in copy_callback()
1785 static void start_copy(struct dm_snap_pending_exception *pe) in start_copy() argument
1787 struct dm_snapshot *s = pe->snap; in start_copy()
1795 src.sector = chunk_to_sector(s->store, pe->e.old_chunk); in start_copy()
1799 dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); in start_copy()
1804 dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe); in start_copy()
1814 static void start_full_bio(struct dm_snap_pending_exception *pe, in start_full_bio() argument
1817 struct dm_snapshot *s = pe->snap; in start_full_bio()
1820 pe->full_bio = bio; in start_full_bio()
1821 pe->full_bio_end_io = bio->bi_end_io; in start_full_bio()
1825 copy_callback, pe); in start_full_bio()
1852 struct dm_snap_pending_exception *pe, chunk_t chunk) in __insert_pending_exception() argument
1854 pe->e.old_chunk = chunk; in __insert_pending_exception()
1855 bio_list_init(&pe->origin_bios); in __insert_pending_exception()
1856 bio_list_init(&pe->snapshot_bios); in __insert_pending_exception()
1857 pe->started = 0; in __insert_pending_exception()
1858 pe->full_bio = NULL; in __insert_pending_exception()
1861 if (s->store->type->prepare_exception(s->store, &pe->e)) { in __insert_pending_exception()
1863 free_pending_exception(pe); in __insert_pending_exception()
1867 pe->exception_sequence = s->exception_start_sequence++; in __insert_pending_exception()
1870 dm_insert_exception(&s->pending, &pe->e); in __insert_pending_exception()
1872 return pe; in __insert_pending_exception()
1885 struct dm_snap_pending_exception *pe, chunk_t chunk) in __find_pending_exception() argument
1891 free_pending_exception(pe); in __find_pending_exception()
1895 return __insert_pending_exception(s, pe, chunk); in __find_pending_exception()
1945 struct dm_snap_pending_exception *pe = NULL; in snapshot_map() local
2023 pe = __lookup_pending_exception(s, chunk); in snapshot_map()
2024 if (!pe) { in snapshot_map()
2026 pe = alloc_pending_exception(s); in snapshot_map()
2031 free_pending_exception(pe); in snapshot_map()
2036 pe = __find_pending_exception(s, pe, chunk); in snapshot_map()
2037 if (!pe) { in snapshot_map()
2057 remap_exception(s, &pe->e, bio, chunk); in snapshot_map()
2061 if (!pe->started && io_overlaps_chunk(s, bio)) { in snapshot_map()
2062 pe->started = 1; in snapshot_map()
2067 start_full_bio(pe, bio); in snapshot_map()
2071 bio_list_add(&pe->snapshot_bios, bio); in snapshot_map()
2073 if (!pe->started) { in snapshot_map()
2075 pe->started = 1; in snapshot_map()
2080 start_copy(pe); in snapshot_map()
2431 struct dm_snap_pending_exception *pe, *pe2; in __origin_write() local
2464 pe = __lookup_pending_exception(snap, chunk); in __origin_write()
2465 if (!pe) { in __origin_write()
2476 pe = alloc_pending_exception(snap); in __origin_write()
2484 free_pending_exception(pe); in __origin_write()
2488 pe = __insert_pending_exception(snap, pe, chunk); in __origin_write()
2489 if (!pe) { in __origin_write()
2497 free_pending_exception(pe); in __origin_write()
2498 pe = pe2; in __origin_write()
2510 bio_list_add(&pe->origin_bios, bio); in __origin_write()
2513 if (!pe->started) { in __origin_write()
2514 pe->started = 1; in __origin_write()
2515 pe_to_start_last = pe; in __origin_write()
2519 if (!pe->started) { in __origin_write()
2520 pe->started = 1; in __origin_write()
2521 pe_to_start_now = pe; in __origin_write()