Source
2331
2331
available_sectors = o->split_boundary -
2332
2332
((unsigned)bio->bi_iter.bi_sector & (o->split_boundary - 1));
2333
2333
2334
2334
if (bio_sectors(bio) > available_sectors)
2335
2335
dm_accept_partial_bio(bio, available_sectors);
2336
2336
2337
2337
/* Only tell snapshots if this is a write */
2338
2338
return do_origin(o->dev, bio);
2339
2339
}
2340
2340
2341
-
static long origin_dax_direct_access(struct dm_target *ti, pgoff_t pgoff,
2342
-
long nr_pages, void **kaddr, pfn_t *pfn)
2343
-
{
2344
-
DMWARN("device does not support dax.");
2345
-
return -EIO;
2346
-
}
2347
-
2348
2341
/*
2349
2342
* Set the target "max_io_len" field to the minimum of all the snapshots'
2350
2343
* chunk sizes.
2351
2344
*/
2352
2345
static void origin_resume(struct dm_target *ti)
2353
2346
{
2354
2347
struct dm_origin *o = ti->private;
2355
2348
2356
2349
o->split_boundary = get_origin_minimum_chunksize(o->dev->bdev);
2357
2350
2397
2390
.name = "snapshot-origin",
2398
2391
.version = {1, 9, 0},
2399
2392
.module = THIS_MODULE,
2400
2393
.ctr = origin_ctr,
2401
2394
.dtr = origin_dtr,
2402
2395
.map = origin_map,
2403
2396
.resume = origin_resume,
2404
2397
.postsuspend = origin_postsuspend,
2405
2398
.status = origin_status,
2406
2399
.iterate_devices = origin_iterate_devices,
2407
-
.direct_access = origin_dax_direct_access,
2408
2400
};
2409
2401
2410
2402
static struct target_type snapshot_target = {
2411
2403
.name = "snapshot",
2412
2404
.version = {1, 15, 0},
2413
2405
.module = THIS_MODULE,
2414
2406
.ctr = snapshot_ctr,
2415
2407
.dtr = snapshot_dtr,
2416
2408
.map = snapshot_map,
2417
2409
.end_io = snapshot_end_io,