Lines Matching refs:pe
701 struct dm_snap_pending_exception *pe = mempool_alloc(s->pending_pool, in alloc_pending_exception() local
705 pe->snap = s; in alloc_pending_exception()
707 return pe; in alloc_pending_exception()
710 static void free_pending_exception(struct dm_snap_pending_exception *pe) in free_pending_exception() argument
712 struct dm_snapshot *s = pe->snap; in free_pending_exception()
714 mempool_free(pe, s->pending_pool); in free_pending_exception()
1519 struct dm_snap_pending_exception *pe = context; in pending_complete() local
1521 struct dm_snapshot *s = pe->snap; in pending_complete()
1542 *e = pe->e; in pending_complete()
1552 __check_for_conflicting_io(s, pe->e.old_chunk); in pending_complete()
1561 dm_remove_exception(&pe->e); in pending_complete()
1562 snapshot_bios = bio_list_get(&pe->snapshot_bios); in pending_complete()
1563 origin_bios = bio_list_get(&pe->origin_bios); in pending_complete()
1564 full_bio = pe->full_bio; in pending_complete()
1566 full_bio->bi_end_io = pe->full_bio_end_io; in pending_complete()
1584 free_pending_exception(pe); in pending_complete()
1587 static void complete_exception(struct dm_snap_pending_exception *pe) in complete_exception() argument
1589 struct dm_snapshot *s = pe->snap; in complete_exception()
1592 s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error, in complete_exception()
1593 pending_complete, pe); in complete_exception()
1602 struct dm_snap_pending_exception *pe = context; in copy_callback() local
1603 struct dm_snapshot *s = pe->snap; in copy_callback()
1605 pe->copy_error = read_err || write_err; in copy_callback()
1607 if (pe->exception_sequence == s->exception_complete_sequence) { in copy_callback()
1609 complete_exception(pe); in copy_callback()
1612 pe = list_entry(s->out_of_order_list.next, in copy_callback()
1614 if (pe->exception_sequence != s->exception_complete_sequence) in copy_callback()
1617 list_del(&pe->out_of_order_entry); in copy_callback()
1618 complete_exception(pe); in copy_callback()
1626 if (pe2->exception_sequence < pe->exception_sequence) in copy_callback()
1629 list_add(&pe->out_of_order_entry, lh); in copy_callback()
1637 static void start_copy(struct dm_snap_pending_exception *pe) in start_copy() argument
1639 struct dm_snapshot *s = pe->snap; in start_copy()
1647 src.sector = chunk_to_sector(s->store, pe->e.old_chunk); in start_copy()
1651 dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); in start_copy()
1656 dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe); in start_copy()
1666 static void start_full_bio(struct dm_snap_pending_exception *pe, in start_full_bio() argument
1669 struct dm_snapshot *s = pe->snap; in start_full_bio()
1672 pe->full_bio = bio; in start_full_bio()
1673 pe->full_bio_end_io = bio->bi_end_io; in start_full_bio()
1677 copy_callback, pe); in start_full_bio()
1706 struct dm_snap_pending_exception *pe, chunk_t chunk) in __find_pending_exception() argument
1712 free_pending_exception(pe); in __find_pending_exception()
1716 pe->e.old_chunk = chunk; in __find_pending_exception()
1717 bio_list_init(&pe->origin_bios); in __find_pending_exception()
1718 bio_list_init(&pe->snapshot_bios); in __find_pending_exception()
1719 pe->started = 0; in __find_pending_exception()
1720 pe->full_bio = NULL; in __find_pending_exception()
1722 if (s->store->type->prepare_exception(s->store, &pe->e)) { in __find_pending_exception()
1723 free_pending_exception(pe); in __find_pending_exception()
1727 pe->exception_sequence = s->exception_start_sequence++; in __find_pending_exception()
1729 dm_insert_exception(&s->pending, &pe->e); in __find_pending_exception()
1731 return pe; in __find_pending_exception()
1750 struct dm_snap_pending_exception *pe = NULL; in snapshot_map() local
1791 pe = __lookup_pending_exception(s, chunk); in snapshot_map()
1792 if (!pe) { in snapshot_map()
1794 pe = alloc_pending_exception(s); in snapshot_map()
1798 free_pending_exception(pe); in snapshot_map()
1805 free_pending_exception(pe); in snapshot_map()
1810 pe = __find_pending_exception(s, pe, chunk); in snapshot_map()
1811 if (!pe) { in snapshot_map()
1822 remap_exception(s, &pe->e, bio, chunk); in snapshot_map()
1826 if (!pe->started && in snapshot_map()
1829 pe->started = 1; in snapshot_map()
1831 start_full_bio(pe, bio); in snapshot_map()
1835 bio_list_add(&pe->snapshot_bios, bio); in snapshot_map()
1837 if (!pe->started) { in snapshot_map()
1839 pe->started = 1; in snapshot_map()
1841 start_copy(pe); in snapshot_map()
2147 struct dm_snap_pending_exception *pe; in __origin_write() local
2186 pe = __lookup_pending_exception(snap, chunk); in __origin_write()
2187 if (!pe) { in __origin_write()
2189 pe = alloc_pending_exception(snap); in __origin_write()
2193 free_pending_exception(pe); in __origin_write()
2199 free_pending_exception(pe); in __origin_write()
2203 pe = __find_pending_exception(snap, pe, chunk); in __origin_write()
2204 if (!pe) { in __origin_write()
2218 bio_list_add(&pe->origin_bios, bio); in __origin_write()
2221 if (!pe->started) { in __origin_write()
2222 pe->started = 1; in __origin_write()
2223 pe_to_start_last = pe; in __origin_write()
2227 if (!pe->started) { in __origin_write()
2228 pe->started = 1; in __origin_write()
2229 pe_to_start_now = pe; in __origin_write()