aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-snap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index a1f2ab553b92..96feada5e761 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -2171,6 +2171,21 @@ static int origin_status(struct dm_target *ti, status_type_t type, char *result,
2171 return 0; 2171 return 0;
2172} 2172}
2173 2173
2174static int origin_merge(struct dm_target *ti, struct bvec_merge_data *bvm,
2175 struct bio_vec *biovec, int max_size)
2176{
2177 struct dm_dev *dev = ti->private;
2178 struct request_queue *q = bdev_get_queue(dev->bdev);
2179
2180 if (!q->merge_bvec_fn)
2181 return max_size;
2182
2183 bvm->bi_bdev = dev->bdev;
2184 bvm->bi_sector = bvm->bi_sector;
2185
2186 return min(max_size, q->merge_bvec_fn(q, bvm, biovec));
2187}
2188
2174static int origin_iterate_devices(struct dm_target *ti, 2189static int origin_iterate_devices(struct dm_target *ti,
2175 iterate_devices_callout_fn fn, void *data) 2190 iterate_devices_callout_fn fn, void *data)
2176{ 2191{
@@ -2188,6 +2203,7 @@ static struct target_type origin_target = {
2188 .map = origin_map, 2203 .map = origin_map,
2189 .resume = origin_resume, 2204 .resume = origin_resume,
2190 .status = origin_status, 2205 .status = origin_status,
2206 .merge = origin_merge,
2191 .iterate_devices = origin_iterate_devices, 2207 .iterate_devices = origin_iterate_devices,
2192}; 2208};
2193 2209