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()
852 * Return a minimum chunk size of all snapshots that have the specified origin.
853 * Return zero if the origin has no snapshots.
855 static uint32_t __minimum_chunk_size(struct origin *o) in __minimum_chunk_size()
1080 * from the exception store to the origin in snapshot_merge_next_chunks()
1084 dest.bdev = s->origin->bdev; in snapshot_merge_next_chunks()
1141 if (blkdev_issue_flush(s->origin->bdev) < 0) { in merge_callback()
1278 r = dm_get_device(ti, origin_path, origin_mode, &s->origin); in snapshot_ctr()
1280 ti->error = "Cannot get origin device"; in snapshot_ctr()
1293 if (s->cow->bdev && s->cow->bdev == s->origin->bdev) { in snapshot_ctr()
1294 ti->error = "COW device cannot be the same as origin device"; in snapshot_ctr()
1360 /* Add snapshot to the list of snapshots for this origin */ in snapshot_ctr()
1364 ti->error = "Snapshot origin struct allocation failed"; in snapshot_ctr()
1418 dm_put_device(ti, s->origin); in snapshot_ctr()
1490 /* Prevent further origin writes from using this snapshot. */ in snapshot_dtr()
1515 dm_put_device(ti, s->origin); in snapshot_dtr()
1583 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit);
1596 r = do_origin(s->origin, bio, false); in retry_origin_bios()
1689 * as the pending exception exists, neither origin writes nor snapshot in pending_complete()
1690 * merging can overwrite the chunk in origin. in pending_complete()
1798 struct block_device *bdev = s->origin->bdev; in start_copy()
1989 * passdown discard to origin (without triggering in snapshot_map()
1991 * defeat the goal of freeing space in origin that is in snapshot_map()
1994 bio_set_dev(bio, s->origin->bdev); in snapshot_map()
2093 bio_set_dev(bio, s->origin->bdev); in snapshot_map()
2106 * target and a snapshot-origin target. It only generates new
2111 * redirect I/O to the cow device. Otherwise I/O is sent to the origin,
2127 bio_set_dev(bio, s->origin->bdev); in snapshot_merge_map()
2143 /* Full merging snapshots are redirected to the origin */ in snapshot_merge_map()
2155 bio_set_dev(bio, s->origin->bdev); in snapshot_merge_map()
2169 bio_set_dev(bio, s->origin->bdev); in snapshot_merge_map()
2173 return do_origin(s->origin, bio, false); in snapshot_merge_map()
2234 o = __lookup_dm_origin(s->origin->bdev); in snapshot_resume()
2308 * snapshot-merge acts as an origin, so set ti->max_io_len in snapshot_merge_resume()
2310 ti->max_io_len = get_origin_minimum_chunksize(s->origin->bdev); in snapshot_merge_resume()
2359 DMEMIT("%s %s", snap->origin->name, snap->cow->name); in snapshot_status()
2374 DMEMIT(",snap_origin_name=%s", snap->origin->name); in snapshot_status()
2390 r = fn(ti, snap->origin, 0, ti->len, data); in snapshot_iterate_devices()
2421 * Origin methods
2427 * (No remapping actually occurs as the origin is always a direct linear
2446 /* Do all the snapshots on this origin */ in __origin_write()
2514 * If an origin bio was supplied, queue it to wait for the in __origin_write()
2554 * Called on a write from the origin driver.
2556 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit) in do_origin() argument
2558 struct origin *o; in do_origin()
2563 o = __lookup_origin(origin->bdev); in do_origin()
2598 struct origin *o; in origin_write_extent()
2601 * The origin's __minimum_chunk_size() got stored in max_io_len in origin_write_extent()
2605 o = __lookup_origin(merging_snap->origin->bdev); in origin_write_extent()
2616 * Origin: maps a linear range of a device, with hooks for snapshotting.
2620 * Construct an origin mapping: <dev_path>
2621 * The context for an origin is merely a 'struct dm_dev *'
2630 ti->error = "origin: incorrect number of arguments"; in origin_ctr()
2636 ti->error = "Cannot allocate private origin structure"; in origin_ctr()
2742 .name = "snapshot-origin",
2865 MODULE_ALIAS("dm-snapshot-origin");