Lines Matching refs:pe

686 	struct dm_snap_pending_exception *pe = mempool_alloc(&s->pending_pool,  in alloc_pending_exception()  local
690 pe->snap = s; in alloc_pending_exception()
692 return pe; in alloc_pending_exception()
695 static void free_pending_exception(struct dm_snap_pending_exception *pe) in free_pending_exception() argument
697 struct dm_snapshot *s = pe->snap; in free_pending_exception()
699 mempool_free(pe, &s->pending_pool); in free_pending_exception()
1453 struct dm_snap_pending_exception *pe = context; in pending_complete() local
1455 struct dm_snapshot *s = pe->snap; in pending_complete()
1476 *e = pe->e; in pending_complete()
1486 __check_for_conflicting_io(s, pe->e.old_chunk); in pending_complete()
1495 dm_remove_exception(&pe->e); in pending_complete()
1496 snapshot_bios = bio_list_get(&pe->snapshot_bios); in pending_complete()
1497 origin_bios = bio_list_get(&pe->origin_bios); in pending_complete()
1498 full_bio = pe->full_bio; in pending_complete()
1500 full_bio->bi_end_io = pe->full_bio_end_io; in pending_complete()
1518 free_pending_exception(pe); in pending_complete()
1521 static void complete_exception(struct dm_snap_pending_exception *pe) in complete_exception() argument
1523 struct dm_snapshot *s = pe->snap; in complete_exception()
1526 s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error, in complete_exception()
1527 pending_complete, pe); in complete_exception()
1536 struct dm_snap_pending_exception *pe = context; in copy_callback() local
1537 struct dm_snapshot *s = pe->snap; in copy_callback()
1539 pe->copy_error = read_err || write_err; in copy_callback()
1541 if (pe->exception_sequence == s->exception_complete_sequence) { in copy_callback()
1545 complete_exception(pe); in copy_callback()
1549 pe = rb_entry(next, struct dm_snap_pending_exception, in copy_callback()
1551 if (pe->exception_sequence != s->exception_complete_sequence) in copy_callback()
1555 rb_erase(&pe->out_of_order_node, &s->out_of_order_tree); in copy_callback()
1556 complete_exception(pe); in copy_callback()
1568 BUG_ON(pe->exception_sequence == pe2->exception_sequence); in copy_callback()
1569 if (pe->exception_sequence < pe2->exception_sequence) in copy_callback()
1575 rb_link_node(&pe->out_of_order_node, parent, p); in copy_callback()
1576 rb_insert_color(&pe->out_of_order_node, &s->out_of_order_tree); in copy_callback()
1583 static void start_copy(struct dm_snap_pending_exception *pe) in start_copy() argument
1585 struct dm_snapshot *s = pe->snap; in start_copy()
1593 src.sector = chunk_to_sector(s->store, pe->e.old_chunk); in start_copy()
1597 dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); in start_copy()
1601 dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe); in start_copy()
1611 static void start_full_bio(struct dm_snap_pending_exception *pe, in start_full_bio() argument
1614 struct dm_snapshot *s = pe->snap; in start_full_bio()
1617 pe->full_bio = bio; in start_full_bio()
1618 pe->full_bio_end_io = bio->bi_end_io; in start_full_bio()
1621 copy_callback, pe); in start_full_bio()
1650 struct dm_snap_pending_exception *pe, chunk_t chunk) in __find_pending_exception() argument
1656 free_pending_exception(pe); in __find_pending_exception()
1660 pe->e.old_chunk = chunk; in __find_pending_exception()
1661 bio_list_init(&pe->origin_bios); in __find_pending_exception()
1662 bio_list_init(&pe->snapshot_bios); in __find_pending_exception()
1663 pe->started = 0; in __find_pending_exception()
1664 pe->full_bio = NULL; in __find_pending_exception()
1666 if (s->store->type->prepare_exception(s->store, &pe->e)) { in __find_pending_exception()
1667 free_pending_exception(pe); in __find_pending_exception()
1671 pe->exception_sequence = s->exception_start_sequence++; in __find_pending_exception()
1673 dm_insert_exception(&s->pending, &pe->e); in __find_pending_exception()
1675 return pe; in __find_pending_exception()
1694 struct dm_snap_pending_exception *pe = NULL; in snapshot_map() local
1731 pe = __lookup_pending_exception(s, chunk); in snapshot_map()
1732 if (!pe) { in snapshot_map()
1734 pe = alloc_pending_exception(s); in snapshot_map()
1738 free_pending_exception(pe); in snapshot_map()
1745 free_pending_exception(pe); in snapshot_map()
1750 pe = __find_pending_exception(s, pe, chunk); in snapshot_map()
1751 if (!pe) { in snapshot_map()
1762 remap_exception(s, &pe->e, bio, chunk); in snapshot_map()
1766 if (!pe->started && in snapshot_map()
1769 pe->started = 1; in snapshot_map()
1771 start_full_bio(pe, bio); in snapshot_map()
1775 bio_list_add(&pe->snapshot_bios, bio); in snapshot_map()
1777 if (!pe->started) { in snapshot_map()
1779 pe->started = 1; in snapshot_map()
1781 start_copy(pe); in snapshot_map()
2088 struct dm_snap_pending_exception *pe; in __origin_write() local
2127 pe = __lookup_pending_exception(snap, chunk); in __origin_write()
2128 if (!pe) { in __origin_write()
2130 pe = alloc_pending_exception(snap); in __origin_write()
2134 free_pending_exception(pe); in __origin_write()
2140 free_pending_exception(pe); in __origin_write()
2144 pe = __find_pending_exception(snap, pe, chunk); in __origin_write()
2145 if (!pe) { in __origin_write()
2159 bio_list_add(&pe->origin_bios, bio); in __origin_write()
2162 if (!pe->started) { in __origin_write()
2163 pe->started = 1; in __origin_write()
2164 pe_to_start_last = pe; in __origin_write()
2168 if (!pe->started) { in __origin_write()
2169 pe->started = 1; in __origin_write()
2170 pe_to_start_now = pe; in __origin_write()