Lines Matching refs:e

179 	struct dm_exception e;  member
644 static void dm_remove_exception(struct dm_exception *e) in dm_remove_exception() argument
646 list_del(&e->hash_list); in dm_remove_exception()
657 struct dm_exception *e; in dm_lookup_exception() local
660 list_for_each_entry (e, slot, hash_list) in dm_lookup_exception()
661 if (chunk >= e->old_chunk && in dm_lookup_exception()
662 chunk <= e->old_chunk + dm_consecutive_chunk_count(e)) in dm_lookup_exception()
663 return e; in dm_lookup_exception()
670 struct dm_exception *e; in alloc_completed_exception() local
672 e = kmem_cache_alloc(exception_cache, gfp); in alloc_completed_exception()
673 if (!e && gfp == GFP_NOIO) in alloc_completed_exception()
674 e = kmem_cache_alloc(exception_cache, GFP_ATOMIC); in alloc_completed_exception()
676 return e; in alloc_completed_exception()
679 static void free_completed_exception(struct dm_exception *e) in free_completed_exception() argument
681 kmem_cache_free(exception_cache, e); in free_completed_exception()
708 struct dm_exception *e = NULL; in dm_insert_exception() local
717 list_for_each_entry_reverse(e, l, hash_list) { in dm_insert_exception()
719 if (new_e->old_chunk == (e->old_chunk + in dm_insert_exception()
720 dm_consecutive_chunk_count(e) + 1) && in dm_insert_exception()
721 new_e->new_chunk == (dm_chunk_number(e->new_chunk) + in dm_insert_exception()
722 dm_consecutive_chunk_count(e) + 1)) { in dm_insert_exception()
723 dm_consecutive_chunk_count_inc(e); in dm_insert_exception()
729 if (new_e->old_chunk == (e->old_chunk - 1) && in dm_insert_exception()
730 new_e->new_chunk == (dm_chunk_number(e->new_chunk) - 1)) { in dm_insert_exception()
731 dm_consecutive_chunk_count_inc(e); in dm_insert_exception()
732 e->old_chunk--; in dm_insert_exception()
733 e->new_chunk--; in dm_insert_exception()
738 if (new_e->old_chunk > e->old_chunk) in dm_insert_exception()
743 list_add(&new_e->hash_list, e ? &e->hash_list : l); in dm_insert_exception()
753 struct dm_exception *e; in dm_add_exception() local
755 e = alloc_completed_exception(GFP_KERNEL); in dm_add_exception()
756 if (!e) in dm_add_exception()
759 e->old_chunk = old; in dm_add_exception()
762 e->new_chunk = new; in dm_add_exception()
764 dm_insert_exception(&s->complete, e); in dm_add_exception()
859 struct dm_exception *e; in __remove_single_exception_chunk() local
861 e = dm_lookup_exception(&s->complete, old_chunk); in __remove_single_exception_chunk()
862 if (!e) { in __remove_single_exception_chunk()
872 if (!dm_consecutive_chunk_count(e)) { in __remove_single_exception_chunk()
873 dm_remove_exception(e); in __remove_single_exception_chunk()
874 free_completed_exception(e); in __remove_single_exception_chunk()
886 if (old_chunk == e->old_chunk) { in __remove_single_exception_chunk()
887 e->old_chunk++; in __remove_single_exception_chunk()
888 e->new_chunk++; in __remove_single_exception_chunk()
889 } else if (old_chunk != e->old_chunk + in __remove_single_exception_chunk()
890 dm_consecutive_chunk_count(e)) { in __remove_single_exception_chunk()
894 (unsigned long long)e->old_chunk, in __remove_single_exception_chunk()
896 e->old_chunk + dm_consecutive_chunk_count(e)); in __remove_single_exception_chunk()
900 dm_consecutive_chunk_count_dec(e); in __remove_single_exception_chunk()
1453 struct dm_exception *e; in pending_complete() local
1468 e = alloc_completed_exception(GFP_NOIO); in pending_complete()
1469 if (!e) { in pending_complete()
1475 *e = pe->e; in pending_complete()
1479 free_completed_exception(e); in pending_complete()
1485 __check_for_conflicting_io(s, pe->e.old_chunk); in pending_complete()
1491 dm_insert_exception(&s->complete, e); in pending_complete()
1494 dm_remove_exception(&pe->e); in pending_complete()
1527 s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error, in complete_exception()
1581 src.sector = chunk_to_sector(s->store, pe->e.old_chunk); in start_copy()
1585 dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); in start_copy()
1621 struct dm_exception *e = dm_lookup_exception(&s->pending, chunk); in __lookup_pending_exception() local
1623 if (!e) in __lookup_pending_exception()
1626 return container_of(e, struct dm_snap_pending_exception, e); in __lookup_pending_exception()
1649 pe->e.old_chunk = chunk; in __find_pending_exception()
1655 if (s->store->type->prepare_exception(s->store, &pe->e)) { in __find_pending_exception()
1662 dm_insert_exception(&s->pending, &pe->e); in __find_pending_exception()
1667 static void remap_exception(struct dm_snapshot *s, struct dm_exception *e, in remap_exception() argument
1672 chunk_to_sector(s->store, dm_chunk_number(e->new_chunk) + in remap_exception()
1673 (chunk - e->old_chunk)) + in remap_exception()
1679 struct dm_exception *e; in snapshot_map() local
1709 e = dm_lookup_exception(&s->complete, chunk); in snapshot_map()
1710 if (e) { in snapshot_map()
1711 remap_exception(s, e, bio, chunk); in snapshot_map()
1733 e = dm_lookup_exception(&s->complete, chunk); in snapshot_map()
1734 if (e) { in snapshot_map()
1736 remap_exception(s, e, bio, chunk); in snapshot_map()
1752 remap_exception(s, &pe->e, bio, chunk); in snapshot_map()
1799 struct dm_exception *e; in snapshot_merge_map() local
1823 e = dm_lookup_exception(&s->complete, chunk); in snapshot_merge_map()
1824 if (e) { in snapshot_merge_map()
1836 remap_exception(s, e, bio, chunk); in snapshot_merge_map()
2076 struct dm_exception *e; in __origin_write() local
2112 e = dm_lookup_exception(&snap->complete, chunk); in __origin_write()
2113 if (e) in __origin_write()
2127 e = dm_lookup_exception(&snap->complete, chunk); in __origin_write()
2128 if (e) { in __origin_write()