Lines Matching refs:origin
52 struct dm_dev *origin;
128 * => use the origin; forget about the snapshot.
131 * (We can't use the intermediate origin state.)
174 return s->origin;
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 {
315 /* The origin device */
320 /* List of snapshots for this origin */
325 * This structure is allocated for each origin target
335 * Size of the hash table for origin volumes. If we make this
388 static struct origin *__lookup_origin(struct block_device *origin)
391 struct origin *o;
393 ol = &_origins[origin_hash(origin)];
395 if (bdev_equal(o->bdev, origin))
401 static void __insert_origin(struct origin *o)
408 static struct dm_origin *__lookup_dm_origin(struct block_device *origin)
413 ol = &_dm_origins[origin_hash(origin)];
415 if (bdev_equal(o->dev->bdev, origin))
438 * snap_merge - an existing snapshot-merge target linked to the same origin.
454 struct origin *o;
458 o = __lookup_origin(snap->origin->bdev);
532 static void __insert_snapshot(struct origin *o, struct dm_snapshot *s)
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;
554 struct block_device *bdev = snap->origin->bdev;
573 /* New origin */
596 struct block_device *bdev = s->origin->bdev;
608 struct origin *o;
611 o = __lookup_origin(s->origin->bdev);
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)
1078 * from the exception store to the origin
1082 dest.bdev = s->origin->bdev;
1139 if (blkdev_issue_flush(s->origin->bdev) < 0) {
1276 r = dm_get_device(ti, origin_path, origin_mode, &s->origin);
1278 ti->error = "Cannot get origin device";
1291 if (s->cow->bdev && s->cow->bdev == s->origin->bdev) {
1292 ti->error = "COW device cannot be the same as origin device";
1358 /* Add snapshot to the list of snapshots for this origin */
1362 ti->error = "Snapshot origin struct allocation failed";
1416 dm_put_device(ti, s->origin);
1488 /* Prevent further origin writes from using this snapshot. */
1513 dm_put_device(ti, s->origin);
1581 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit);
1594 r = do_origin(s->origin, bio, false);
1687 * as the pending exception exists, neither origin writes nor snapshot
1688 * merging can overwrite the chunk in origin.
1796 struct block_device *bdev = s->origin->bdev;
1987 * passdown discard to origin (without triggering
1989 * defeat the goal of freeing space in origin that is
1992 bio_set_dev(bio, s->origin->bdev);
2091 bio_set_dev(bio, s->origin->bdev);
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);
2141 /* Full merging snapshots are redirected to the origin */
2153 bio_set_dev(bio, s->origin->bdev);
2167 bio_set_dev(bio, s->origin->bdev);
2171 return do_origin(s->origin, bio, false);
2232 o = __lookup_dm_origin(s->origin->bdev);
2306 * snapshot-merge acts as an origin, so set ti->max_io_len
2308 ti->max_io_len = get_origin_minimum_chunksize(s->origin->bdev);
2357 DMEMIT("%s %s", snap->origin->name, snap->cow->name);
2372 DMEMIT(",snap_origin_name=%s", snap->origin->name);
2388 r = fn(ti, snap->origin, 0, ti->len, data);
2425 * (No remapping actually occurs as the origin is always a direct linear
2444 /* Do all the snapshots on this origin */
2512 * If an origin bio was supplied, queue it to wait for the
2552 * Called on a write from the origin driver.
2554 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit)
2556 struct origin *o;
2561 o = __lookup_origin(origin->bdev);
2596 struct origin *o;
2599 * The origin's __minimum_chunk_size() got stored in max_io_len
2603 o = __lookup_origin(merging_snap->origin->bdev);
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";
2634 ti->error = "Cannot allocate private origin structure";
2740 .name = "snapshot-origin",
2863 MODULE_ALIAS("dm-snapshot-origin");