Lines Matching refs:snap
182 struct dm_snapshot *snap; member
416 static int __find_snapshots_sharing_cow(struct dm_snapshot *snap, in __find_snapshots_sharing_cow() argument
426 o = __lookup_origin(snap->origin->bdev); in __find_snapshots_sharing_cow()
433 if (!bdev_equal(s->cow->bdev, snap->cow->bdev)) in __find_snapshots_sharing_cow()
457 static int __validate_exception_handover(struct dm_snapshot *snap) in __validate_exception_handover() argument
463 if ((__find_snapshots_sharing_cow(snap, &snap_src, &snap_dest, in __validate_exception_handover()
466 snap->ti->error = "Snapshot cow pairing for exception " in __validate_exception_handover()
481 if (!dm_target_is_snapshot_merge(snap->ti)) in __validate_exception_handover()
488 snap->ti->error = "A snapshot is already merging."; in __validate_exception_handover()
494 snap->ti->error = "Snapshot exception store does not " in __validate_exception_handover()
521 static int register_snapshot(struct dm_snapshot *snap) in register_snapshot() argument
524 struct block_device *bdev = snap->origin->bdev; in register_snapshot()
533 r = __validate_exception_handover(snap); in register_snapshot()
553 __insert_snapshot(o, snap); in register_snapshot()
683 pe->snap = s; in alloc_pending_exception()
690 struct dm_snapshot *s = pe->snap; in free_pending_exception()
768 struct dm_snapshot *snap; in __minimum_chunk_size() local
772 list_for_each_entry(snap, &o->snapshots, list) in __minimum_chunk_size()
774 snap->store->chunk_size); in __minimum_chunk_size()
1299 snap_dest->store->snap = snap_dest; in __handover_exceptions()
1300 snap_src->store->snap = snap_src; in __handover_exceptions()
1435 struct dm_snapshot *s = pe->snap; in pending_complete()
1506 struct dm_snapshot *s = pe->snap; in complete_exception()
1520 struct dm_snapshot *s = pe->snap; in copy_callback()
1555 struct dm_snapshot *s = pe->snap; in start_copy()
1584 struct dm_snapshot *s = pe->snap; in start_full_bio()
1973 struct dm_snapshot *snap = ti->private; in snapshot_status() local
1978 down_write(&snap->lock); in snapshot_status()
1980 if (!snap->valid) in snapshot_status()
1982 else if (snap->merge_failed) in snapshot_status()
1985 if (snap->store->type->usage) { in snapshot_status()
1988 snap->store->type->usage(snap->store, in snapshot_status()
2001 up_write(&snap->lock); in snapshot_status()
2011 DMEMIT("%s %s", snap->origin->name, snap->cow->name); in snapshot_status()
2012 snap->store->type->status(snap->store, type, result + sz, in snapshot_status()
2021 struct dm_snapshot *snap = ti->private; in snapshot_iterate_devices() local
2024 r = fn(ti, snap->origin, 0, ti->len, data); in snapshot_iterate_devices()
2027 r = fn(ti, snap->cow, 0, get_dev_size(snap->cow->bdev), data); in snapshot_iterate_devices()
2051 struct dm_snapshot *snap; in __origin_write() local
2059 list_for_each_entry (snap, snapshots, list) { in __origin_write()
2064 if (dm_target_is_snapshot_merge(snap->ti)) in __origin_write()
2067 down_write(&snap->lock); in __origin_write()
2070 if (!snap->valid || !snap->active) in __origin_write()
2074 if (sector >= dm_table_get_size(snap->ti->table)) in __origin_write()
2081 chunk = sector_to_chunk(snap->store, sector); in __origin_write()
2088 e = dm_lookup_exception(&snap->complete, chunk); in __origin_write()
2092 pe = __lookup_pending_exception(snap, chunk); in __origin_write()
2094 up_write(&snap->lock); in __origin_write()
2095 pe = alloc_pending_exception(snap); in __origin_write()
2096 down_write(&snap->lock); in __origin_write()
2098 if (!snap->valid) { in __origin_write()
2103 e = dm_lookup_exception(&snap->complete, chunk); in __origin_write()
2109 pe = __find_pending_exception(snap, pe, chunk); in __origin_write()
2111 __invalidate_snapshot(snap, -ENOMEM); in __origin_write()
2139 up_write(&snap->lock); in __origin_write()