aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-linear.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r--drivers/md/dm-linear.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 79fb53e51c70..9184b6deb868 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -53,6 +53,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
53 goto bad; 53 goto bad;
54 } 54 }
55 55
56 ti->num_flush_requests = 1;
56 ti->private = lc; 57 ti->private = lc;
57 return 0; 58 return 0;
58 59
@@ -81,7 +82,8 @@ static void linear_map_bio(struct dm_target *ti, struct bio *bio)
81 struct linear_c *lc = ti->private; 82 struct linear_c *lc = ti->private;
82 83
83 bio->bi_bdev = lc->dev->bdev; 84 bio->bi_bdev = lc->dev->bdev;
84 bio->bi_sector = linear_map_sector(ti, bio->bi_sector); 85 if (bio_sectors(bio))
86 bio->bi_sector = linear_map_sector(ti, bio->bi_sector);
85} 87}
86 88
87static int linear_map(struct dm_target *ti, struct bio *bio, 89static int linear_map(struct dm_target *ti, struct bio *bio,
@@ -132,9 +134,17 @@ static int linear_merge(struct dm_target *ti, struct bvec_merge_data *bvm,
132 return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); 134 return min(max_size, q->merge_bvec_fn(q, bvm, biovec));
133} 135}
134 136
137static int linear_iterate_devices(struct dm_target *ti,
138 iterate_devices_callout_fn fn, void *data)
139{
140 struct linear_c *lc = ti->private;
141
142 return fn(ti, lc->dev, lc->start, data);
143}
144
135static struct target_type linear_target = { 145static struct target_type linear_target = {
136 .name = "linear", 146 .name = "linear",
137 .version= {1, 0, 3}, 147 .version = {1, 1, 0},
138 .module = THIS_MODULE, 148 .module = THIS_MODULE,
139 .ctr = linear_ctr, 149 .ctr = linear_ctr,
140 .dtr = linear_dtr, 150 .dtr = linear_dtr,
@@ -142,6 +152,7 @@ static struct target_type linear_target = {
142 .status = linear_status, 152 .status = linear_status,
143 .ioctl = linear_ioctl, 153 .ioctl = linear_ioctl,
144 .merge = linear_merge, 154 .merge = linear_merge,
155 .iterate_devices = linear_iterate_devices,
145}; 156};
146 157
147int __init dm_linear_init(void) 158int __init dm_linear_init(void)