Lines Matching refs:origin
51 struct dm_dev *origin;
127 * => use the origin; forget about the snapshot.
130 * (We can't use the intermediate origin state.)
178 return s->origin;
238 * Hash table mapping origin volumes to lists of snapshots and
314 * One of these per registered origin, held in the snapshot_origins hash
316 struct origin {
317 /* The origin device */
322 /* List of snapshots for this origin */
327 * This structure is allocated for each origin target
337 * Size of the hash table for origin volumes. If we make this
390 static struct origin *__lookup_origin(struct block_device *origin)
393 struct origin *o;
395 ol = &_origins[origin_hash(origin)];
397 if (bdev_equal(o->bdev, origin))
403 static void __insert_origin(struct origin *o)
409 static struct dm_origin *__lookup_dm_origin(struct block_device *origin)
414 ol = &_dm_origins[origin_hash(origin)];
416 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);
534 static void __insert_snapshot(struct origin *o, struct dm_snapshot *s)
546 * Make a note of the snapshot and its origin so we can look it
547 * up when the origin has a write on it.
555 struct origin *o, *new_o = NULL;
556 struct block_device *bdev = snap->origin->bdev;
575 /* New origin */
598 struct block_device *bdev = s->origin->bdev;
610 struct origin *o;
613 o = __lookup_origin(s->origin->bdev);
851 * Return a minimum chunk size of all snapshots that have the specified origin.
852 * Return zero if the origin has no snapshots.
854 static uint32_t __minimum_chunk_size(struct origin *o)
1081 * from the exception store to the origin
1085 dest.bdev = s->origin->bdev;
1134 bio_set_dev(flush_bio, s->origin->bdev);
1291 r = dm_get_device(ti, origin_path, origin_mode, &s->origin);
1293 ti->error = "Cannot get origin device";
1296 origin_dev = s->origin->bdev->bd_dev;
1304 ti->error = "COW device cannot be the same as origin device";
1377 /* Add snapshot to the list of snapshots for this origin */
1381 ti->error = "Snapshot origin struct allocation failed";
1435 dm_put_device(ti, s->origin);
1507 /* Prevent further origin writes from using this snapshot. */
1534 dm_put_device(ti, s->origin);
1601 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit);
1614 r = do_origin(s->origin, bio, false);
1707 * as the pending exception exists, neither origin writes nor snapshot
1708 * merging can overwrite the chunk in origin.
1816 struct block_device *bdev = s->origin->bdev;
2007 * passdown discard to origin (without triggering
2009 * defeat the goal of freeing space in origin that is
2012 bio_set_dev(bio, s->origin->bdev);
2111 bio_set_dev(bio, s->origin->bdev);
2124 * target and a snapshot-origin target. It only generates new
2129 * redirect I/O to the cow device. Otherwise I/O is sent to the origin,
2145 bio_set_dev(bio, s->origin->bdev);
2161 /* Full merging snapshots are redirected to the origin */
2173 bio_set_dev(bio, s->origin->bdev);
2187 bio_set_dev(bio, s->origin->bdev);
2191 return do_origin(s->origin, bio, false);
2254 o = __lookup_dm_origin(s->origin->bdev);
2328 * snapshot-merge acts as an origin, so set ti->max_io_len
2330 ti->max_io_len = get_origin_minimum_chunksize(s->origin->bdev);
2380 DMEMIT("%s %s", snap->origin->name, snap->cow->name);
2401 r = fn(ti, snap->origin, 0, ti->len, data);
2437 * (No remapping actually occurs as the origin is always a direct linear
2456 /* Do all the snapshots on this origin */
2524 * If an origin bio was supplied, queue it to wait for the
2564 * Called on a write from the origin driver.
2566 static int do_origin(struct dm_dev *origin, struct bio *bio, bool limit)
2568 struct origin *o;
2573 o = __lookup_origin(origin->bdev);
2607 struct origin *o;
2610 * The origin's __minimum_chunk_size() got stored in max_io_len
2614 o = __lookup_origin(merging_snap->origin->bdev);
2629 * Construct an origin mapping: <dev_path>
2630 * The context for an origin is merely a 'struct dm_dev *'
2639 ti->error = "origin: incorrect number of arguments";
2645 ti->error = "Cannot allocate private origin structure";
2748 .name = "snapshot-origin",
2877 MODULE_ALIAS("dm-snapshot-origin");