Lines Matching refs:e
172 struct dm_exception e; member
637 static void dm_remove_exception(struct dm_exception *e) in dm_remove_exception() argument
639 list_del(&e->hash_list); in dm_remove_exception()
650 struct dm_exception *e; in dm_lookup_exception() local
653 list_for_each_entry (e, slot, hash_list) in dm_lookup_exception()
654 if (chunk >= e->old_chunk && in dm_lookup_exception()
655 chunk <= e->old_chunk + dm_consecutive_chunk_count(e)) in dm_lookup_exception()
656 return e; in dm_lookup_exception()
663 struct dm_exception *e; in alloc_completed_exception() local
665 e = kmem_cache_alloc(exception_cache, gfp); in alloc_completed_exception()
666 if (!e && gfp == GFP_NOIO) in alloc_completed_exception()
667 e = kmem_cache_alloc(exception_cache, GFP_ATOMIC); in alloc_completed_exception()
669 return e; in alloc_completed_exception()
672 static void free_completed_exception(struct dm_exception *e) in free_completed_exception() argument
674 kmem_cache_free(exception_cache, e); in free_completed_exception()
701 struct dm_exception *e = NULL; in dm_insert_exception() local
710 list_for_each_entry_reverse(e, l, hash_list) { in dm_insert_exception()
712 if (new_e->old_chunk == (e->old_chunk + in dm_insert_exception()
713 dm_consecutive_chunk_count(e) + 1) && in dm_insert_exception()
714 new_e->new_chunk == (dm_chunk_number(e->new_chunk) + in dm_insert_exception()
715 dm_consecutive_chunk_count(e) + 1)) { in dm_insert_exception()
716 dm_consecutive_chunk_count_inc(e); in dm_insert_exception()
722 if (new_e->old_chunk == (e->old_chunk - 1) && in dm_insert_exception()
723 new_e->new_chunk == (dm_chunk_number(e->new_chunk) - 1)) { in dm_insert_exception()
724 dm_consecutive_chunk_count_inc(e); in dm_insert_exception()
725 e->old_chunk--; in dm_insert_exception()
726 e->new_chunk--; in dm_insert_exception()
731 if (new_e->old_chunk > e->old_chunk) in dm_insert_exception()
736 list_add(&new_e->hash_list, e ? &e->hash_list : l); in dm_insert_exception()
746 struct dm_exception *e; in dm_add_exception() local
748 e = alloc_completed_exception(GFP_KERNEL); in dm_add_exception()
749 if (!e) in dm_add_exception()
752 e->old_chunk = old; in dm_add_exception()
755 e->new_chunk = new; in dm_add_exception()
757 dm_insert_exception(&s->complete, e); in dm_add_exception()
852 struct dm_exception *e; in __remove_single_exception_chunk() local
854 e = dm_lookup_exception(&s->complete, old_chunk); in __remove_single_exception_chunk()
855 if (!e) { in __remove_single_exception_chunk()
865 if (!dm_consecutive_chunk_count(e)) { in __remove_single_exception_chunk()
866 dm_remove_exception(e); in __remove_single_exception_chunk()
867 free_completed_exception(e); in __remove_single_exception_chunk()
879 if (old_chunk == e->old_chunk) { in __remove_single_exception_chunk()
880 e->old_chunk++; in __remove_single_exception_chunk()
881 e->new_chunk++; in __remove_single_exception_chunk()
882 } else if (old_chunk != e->old_chunk + in __remove_single_exception_chunk()
883 dm_consecutive_chunk_count(e)) { in __remove_single_exception_chunk()
887 (unsigned long long)e->old_chunk, in __remove_single_exception_chunk()
889 e->old_chunk + dm_consecutive_chunk_count(e)); in __remove_single_exception_chunk()
893 dm_consecutive_chunk_count_dec(e); in __remove_single_exception_chunk()
1434 struct dm_exception *e; in pending_complete() local
1449 e = alloc_completed_exception(GFP_NOIO); in pending_complete()
1450 if (!e) { in pending_complete()
1456 *e = pe->e; in pending_complete()
1460 free_completed_exception(e); in pending_complete()
1466 __check_for_conflicting_io(s, pe->e.old_chunk); in pending_complete()
1472 dm_insert_exception(&s->complete, e); in pending_complete()
1475 dm_remove_exception(&pe->e); in pending_complete()
1509 s->store->type->commit_exception(s->store, &pe->e, !pe->copy_error, in complete_exception()
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()
1603 struct dm_exception *e = dm_lookup_exception(&s->pending, chunk); in __lookup_pending_exception() local
1605 if (!e) in __lookup_pending_exception()
1608 return container_of(e, struct dm_snap_pending_exception, e); in __lookup_pending_exception()
1631 pe->e.old_chunk = chunk; in __find_pending_exception()
1637 if (s->store->type->prepare_exception(s->store, &pe->e)) { in __find_pending_exception()
1644 dm_insert_exception(&s->pending, &pe->e); in __find_pending_exception()
1649 static void remap_exception(struct dm_snapshot *s, struct dm_exception *e, in remap_exception() argument
1654 chunk_to_sector(s->store, dm_chunk_number(e->new_chunk) + in remap_exception()
1655 (chunk - e->old_chunk)) + in remap_exception()
1661 struct dm_exception *e; in snapshot_map() local
1691 e = dm_lookup_exception(&s->complete, chunk); in snapshot_map()
1692 if (e) { in snapshot_map()
1693 remap_exception(s, e, bio, chunk); in snapshot_map()
1715 e = dm_lookup_exception(&s->complete, chunk); in snapshot_map()
1716 if (e) { in snapshot_map()
1718 remap_exception(s, e, bio, chunk); in snapshot_map()
1730 remap_exception(s, &pe->e, bio, chunk); in snapshot_map()
1777 struct dm_exception *e; in snapshot_merge_map() local
1801 e = dm_lookup_exception(&s->complete, chunk); in snapshot_merge_map()
1802 if (e) { in snapshot_merge_map()
1814 remap_exception(s, e, bio, chunk); in snapshot_merge_map()
2052 struct dm_exception *e; in __origin_write() local
2088 e = dm_lookup_exception(&snap->complete, chunk); in __origin_write()
2089 if (e) in __origin_write()
2103 e = dm_lookup_exception(&snap->complete, chunk); in __origin_write()
2104 if (e) { in __origin_write()