Lines Matching refs:pe

679 	struct dm_snap_pending_exception *pe = mempool_alloc(s->pending_pool,  in alloc_pending_exception()  local
683 pe->snap = s; in alloc_pending_exception()
685 return pe; in alloc_pending_exception()
688 static void free_pending_exception(struct dm_snap_pending_exception *pe) in free_pending_exception() argument
690 struct dm_snapshot *s = pe->snap; in free_pending_exception()
692 mempool_free(pe, s->pending_pool); in free_pending_exception()
1433 struct dm_snap_pending_exception *pe = context; in pending_complete() local
1435 struct dm_snapshot *s = pe->snap; in pending_complete()
1456 *e = pe->e; in pending_complete()
1466 __check_for_conflicting_io(s, pe->e.old_chunk); in pending_complete()
1475 dm_remove_exception(&pe->e); in pending_complete()
1476 snapshot_bios = bio_list_get(&pe->snapshot_bios); in pending_complete()
1477 origin_bios = bio_list_get(&pe->origin_bios); in pending_complete()
1478 full_bio = pe->full_bio; in pending_complete()
1480 full_bio->bi_end_io = pe->full_bio_end_io; in pending_complete()
1481 full_bio->bi_private = pe->full_bio_private; in pending_complete()
1501 free_pending_exception(pe); in pending_complete()
1504 static void complete_exception(struct dm_snap_pending_exception *pe) in complete_exception() argument
1506 struct dm_snapshot *s = pe->snap; in complete_exception()
1509 s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error, in complete_exception()
1510 pending_complete, pe); in complete_exception()
1519 struct dm_snap_pending_exception *pe = context; in copy_callback() local
1520 struct dm_snapshot *s = pe->snap; in copy_callback()
1522 pe->copy_error = read_err || write_err; in copy_callback()
1524 if (pe->exception_sequence == s->exception_complete_sequence) { in copy_callback()
1526 complete_exception(pe); in copy_callback()
1529 pe = list_entry(s->out_of_order_list.next, in copy_callback()
1531 if (pe->exception_sequence != s->exception_complete_sequence) in copy_callback()
1534 list_del(&pe->out_of_order_entry); in copy_callback()
1535 complete_exception(pe); in copy_callback()
1543 if (pe2->exception_sequence < pe->exception_sequence) in copy_callback()
1546 list_add(&pe->out_of_order_entry, lh); in copy_callback()
1553 static void start_copy(struct dm_snap_pending_exception *pe) in start_copy() argument
1555 struct dm_snapshot *s = pe->snap; in start_copy()
1563 src.sector = chunk_to_sector(s->store, pe->e.old_chunk); in start_copy()
1567 dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); in start_copy()
1571 dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe); in start_copy()
1581 static void start_full_bio(struct dm_snap_pending_exception *pe, in start_full_bio() argument
1584 struct dm_snapshot *s = pe->snap; in start_full_bio()
1587 pe->full_bio = bio; in start_full_bio()
1588 pe->full_bio_end_io = bio->bi_end_io; in start_full_bio()
1589 pe->full_bio_private = bio->bi_private; in start_full_bio()
1592 copy_callback, pe); in start_full_bio()
1621 struct dm_snap_pending_exception *pe, chunk_t chunk) in __find_pending_exception() argument
1627 free_pending_exception(pe); in __find_pending_exception()
1631 pe->e.old_chunk = chunk; in __find_pending_exception()
1632 bio_list_init(&pe->origin_bios); in __find_pending_exception()
1633 bio_list_init(&pe->snapshot_bios); in __find_pending_exception()
1634 pe->started = 0; in __find_pending_exception()
1635 pe->full_bio = NULL; in __find_pending_exception()
1637 if (s->store->type->prepare_exception(s->store, &pe->e)) { in __find_pending_exception()
1638 free_pending_exception(pe); in __find_pending_exception()
1642 pe->exception_sequence = s->exception_start_sequence++; in __find_pending_exception()
1644 dm_insert_exception(&s->pending, &pe->e); in __find_pending_exception()
1646 return pe; in __find_pending_exception()
1665 struct dm_snap_pending_exception *pe = NULL; in snapshot_map() local
1703 pe = __lookup_pending_exception(s, chunk); in snapshot_map()
1704 if (!pe) { in snapshot_map()
1706 pe = alloc_pending_exception(s); in snapshot_map()
1710 free_pending_exception(pe); in snapshot_map()
1717 free_pending_exception(pe); in snapshot_map()
1722 pe = __find_pending_exception(s, pe, chunk); in snapshot_map()
1723 if (!pe) { in snapshot_map()
1730 remap_exception(s, &pe->e, bio, chunk); in snapshot_map()
1734 if (!pe->started && in snapshot_map()
1737 pe->started = 1; in snapshot_map()
1739 start_full_bio(pe, bio); in snapshot_map()
1743 bio_list_add(&pe->snapshot_bios, bio); in snapshot_map()
1745 if (!pe->started) { in snapshot_map()
1747 pe->started = 1; in snapshot_map()
1749 start_copy(pe); in snapshot_map()
2053 struct dm_snap_pending_exception *pe; in __origin_write() local
2092 pe = __lookup_pending_exception(snap, chunk); in __origin_write()
2093 if (!pe) { in __origin_write()
2095 pe = alloc_pending_exception(snap); in __origin_write()
2099 free_pending_exception(pe); in __origin_write()
2105 free_pending_exception(pe); in __origin_write()
2109 pe = __find_pending_exception(snap, pe, chunk); in __origin_write()
2110 if (!pe) { in __origin_write()
2124 bio_list_add(&pe->origin_bios, bio); in __origin_write()
2127 if (!pe->started) { in __origin_write()
2128 pe->started = 1; in __origin_write()
2129 pe_to_start_last = pe; in __origin_write()
2133 if (!pe->started) { in __origin_write()
2134 pe->started = 1; in __origin_write()
2135 pe_to_start_now = pe; in __origin_write()