Lines Matching full:origin

52 	struct dm_dev *origin;  member
57 /* List of snapshots per Origin */
73 /* Origin writes don't trigger exceptions until this is set */
128 * => use the origin; forget about the snapshot.
131 * (We can't use the intermediate origin state.)
174 return s->origin; in dm_snap_origin()
203 * Origin buffers waiting for this to complete are held
234 * Hash table mapping origin volumes to lists of snapshots and
312 * One of these per registered origin, held in the snapshot_origins hash
314 struct origin { struct
315 /* The origin device */
320 /* List of snapshots for this origin */ argument
325 * This structure is allocated for each origin target argument
335 * Size of the hash table for origin volumes. If we make this
388 static struct origin *__lookup_origin(struct block_device *origin) in __lookup_origin() argument
391 struct origin *o; in __lookup_origin()
393 ol = &_origins[origin_hash(origin)]; in __lookup_origin()
395 if (bdev_equal(o->bdev, origin)) in __lookup_origin()
401 static void __insert_origin(struct origin *o) in __insert_origin()
408 static struct dm_origin *__lookup_dm_origin(struct block_device *origin) in __lookup_dm_origin() argument
413 ol = &_dm_origins[origin_hash(origin)]; in __lookup_dm_origin()
415 if (bdev_equal(o->dev->bdev, origin)) in __lookup_dm_origin()
438 * snap_merge - an existing snapshot-merge target linked to the same origin.
454 struct origin *o; in __find_snapshots_sharing_cow()
458 o = __lookup_origin(snap->origin->bdev); in __find_snapshots_sharing_cow()
532 static void __insert_snapshot(struct origin *o, struct dm_snapshot *s) in __insert_snapshot()
544 * Make a note of the snapshot and its origin so we can look it
545 * up when the origin has a write on it.
553 struct origin *o, *new_o = NULL; in register_snapshot()
554 struct block_device *bdev = snap->origin->bdev; in register_snapshot()
573 /* New origin */ in register_snapshot()
596 struct block_device *bdev = s->origin->bdev; in reregister_snapshot()
608 struct origin *o; in unregister_snapshot()
611 o = __lookup_origin(s->origin->bdev); in unregister_snapshot()
850 * Return a minimum chunk size of all snapshots that have the specified origin.
851 * Return zero if the origin has no snapshots.
853 static uint32_t __minimum_chunk_size(struct origin *o) in __minimum_chunk_size()
1078 * from the exception store to the origin in snapshot_merge_next_chunks()
1082 dest.bdev = s->origin->bdev; in snapshot_merge_next_chunks()
1139 if (blkdev_issue_flush(s->origin->bdev) < 0) { in merge_callback()
1276 r = dm_get_device(ti, origin_path, origin_mode, &s->origin); in snapshot_ctr()
1278 ti->error = "Cannot get origin device"; in snapshot_ctr()
1291 if (s->cow->bdev && s->cow->bdev == s->origin->bdev) { in snapshot_ctr()
1292 ti->error = "COW device cannot be the same as origin device"; in snapshot_ctr()
1358 /* Add snapshot to the list of snapshots for this origin */ in snapshot_ctr()
1362 ti->error = "Snapshot origin struct allocation failed"; in snapshot_ctr()
1416 dm_put_device(ti, s->origin); in snapshot_ctr()
1488 /* Prevent further origin writes from using this snapshot. */ in snapshot_dtr()
1513 dm_put_device(ti, s->origin); in snapshot_dtr()
1581 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit);
1594 r = do_origin(s->origin, bio, false); in retry_origin_bios()
1687 * as the pending exception exists, neither origin writes nor snapshot in pending_complete()
1688 * merging can overwrite the chunk in origin. in pending_complete()
1796 struct block_device *bdev = s->origin->bdev; in start_copy()
1987 * passdown discard to origin (without triggering in snapshot_map()
1989 * defeat the goal of freeing space in origin that is in snapshot_map()
1992 bio_set_dev(bio, s->origin->bdev); in snapshot_map()
2091 bio_set_dev(bio, s->origin->bdev); in snapshot_map()
2104 * target and a snapshot-origin target. It only generates new
2109 * redirect I/O to the cow device. Otherwise I/O is sent to the origin,
2125 bio_set_dev(bio, s->origin->bdev); in snapshot_merge_map()
2141 /* Full merging snapshots are redirected to the origin */ in snapshot_merge_map()
2153 bio_set_dev(bio, s->origin->bdev); in snapshot_merge_map()
2167 bio_set_dev(bio, s->origin->bdev); in snapshot_merge_map()
2171 return do_origin(s->origin, bio, false); in snapshot_merge_map()
2232 o = __lookup_dm_origin(s->origin->bdev); in snapshot_resume()
2306 * snapshot-merge acts as an origin, so set ti->max_io_len in snapshot_merge_resume()
2308 ti->max_io_len = get_origin_minimum_chunksize(s->origin->bdev); in snapshot_merge_resume()
2357 DMEMIT("%s %s", snap->origin->name, snap->cow->name); in snapshot_status()
2372 DMEMIT(",snap_origin_name=%s", snap->origin->name); in snapshot_status()
2388 r = fn(ti, snap->origin, 0, ti->len, data); in snapshot_iterate_devices()
2419 * Origin methods
2425 * (No remapping actually occurs as the origin is always a direct linear
2444 /* Do all the snapshots on this origin */ in __origin_write()
2512 * If an origin bio was supplied, queue it to wait for the in __origin_write()
2552 * Called on a write from the origin driver.
2554 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit) in do_origin() argument
2556 struct origin *o; in do_origin()
2561 o = __lookup_origin(origin->bdev); in do_origin()
2596 struct origin *o; in origin_write_extent()
2599 * The origin's __minimum_chunk_size() got stored in max_io_len in origin_write_extent()
2603 o = __lookup_origin(merging_snap->origin->bdev); in origin_write_extent()
2614 * Origin: maps a linear range of a device, with hooks for snapshotting.
2618 * Construct an origin mapping: <dev_path>
2619 * The context for an origin is merely a 'struct dm_dev *'
2628 ti->error = "origin: incorrect number of arguments"; in origin_ctr()
2634 ti->error = "Cannot allocate private origin structure"; in origin_ctr()
2740 .name = "snapshot-origin",
2863 MODULE_ALIAS("dm-snapshot-origin");