Lines Matching +full:linear +full:- +full:mapping +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2001-2003 Sistina Software (UK) Limited.
15 #include <linux/device-mapper.h>
17 #define DM_MSG_PREFIX "linear"
20 * Linear: maps a linear range of a device.
28 * Construct a linear mapping: <dev_path> <offset>
38 ti->error = "Invalid argument count";
39 return -EINVAL;
44 ti->error = "Cannot allocate linear context";
45 return -ENOMEM;
48 ret = -EINVAL;
50 ti->error = "Invalid device sector";
53 lc->start = tmp;
55 ret = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &lc->dev);
57 ti->error = "Device lookup failed";
61 ti->num_flush_bios = 1;
62 ti->num_discard_bios = 1;
63 ti->num_secure_erase_bios = 1;
64 ti->num_write_zeroes_bios = 1;
65 ti->flush_bypasses_map = true;
66 ti->private = lc;
76 struct linear_c *lc = ti->private;
78 dm_put_device(ti, lc->dev);
84 struct linear_c *lc = ti->private;
86 return lc->start + dm_target_offset(ti, bi_sector);
91 struct linear_c *lc = ti->private;
93 bio_set_dev(bio, lc->dev->bdev);
94 bio->bi_iter.bi_sector = linear_map_sector(ti, bio->bi_iter.bi_sector);
102 struct linear_c *lc = ti->private;
111 DMEMIT("%s %llu", lc->dev->name, (unsigned long long)lc->start);
115 DMEMIT_TARGET_NAME_VERSION(ti->type);
116 DMEMIT(",device_name=%s,start=%llu;", lc->dev->name,
117 (unsigned long long)lc->start);
124 struct linear_c *lc = ti->private;
125 struct dm_dev *dev = lc->dev;
127 *bdev = dev->bdev;
132 if (lc->start || ti->len != bdev_nr_sectors(dev->bdev))
141 struct linear_c *lc = ti->private;
143 return dm_report_zones(lc->dev->bdev, lc->start,
144 linear_map_sector(ti, args->next_sector),
154 struct linear_c *lc = ti->private;
156 return fn(ti, lc->dev, lc->start, ti->len, data);
162 struct linear_c *lc = ti->private;
165 *pgoff = (get_start_sect(lc->dev->bdev) + sector) >> PAGE_SECTORS_SHIFT;
166 return lc->dev->dax_dev;
170 long nr_pages, enum dax_access_mode mode, void **kaddr,
175 return dax_direct_access(dax_dev, pgoff, nr_pages, mode, kaddr, pfn);
201 .name = "linear",