dm-stripe.c (ddbd658f6446a35e4d6ba84812fd71023320cae2) dm-stripe.c (7de3ee57da4b717050e79c9313a9bf66ccc72519)
1/*
2 * Copyright (C) 2001-2003 Sistina Software (UK) Limited.
3 *
4 * This file is released under the GPL.
5 */
6
7#include <linux/device-mapper.h>
8

--- 257 unchanged lines hidden (view full) ---

266 return DM_MAPIO_REMAPPED;
267 } else {
268 /* The range doesn't map to the target stripe */
269 bio_endio(bio, 0);
270 return DM_MAPIO_SUBMITTED;
271 }
272}
273
1/*
2 * Copyright (C) 2001-2003 Sistina Software (UK) Limited.
3 *
4 * This file is released under the GPL.
5 */
6
7#include <linux/device-mapper.h>
8

--- 257 unchanged lines hidden (view full) ---

266 return DM_MAPIO_REMAPPED;
267 } else {
268 /* The range doesn't map to the target stripe */
269 bio_endio(bio, 0);
270 return DM_MAPIO_SUBMITTED;
271 }
272}
273
274static int stripe_map(struct dm_target *ti, struct bio *bio,
275 union map_info *map_context)
274static int stripe_map(struct dm_target *ti, struct bio *bio)
276{
277 struct stripe_c *sc = ti->private;
278 uint32_t stripe;
279 unsigned target_request_nr;
280
281 if (bio->bi_rw & REQ_FLUSH) {
282 target_request_nr = dm_bio_get_target_request_nr(bio);
283 BUG_ON(target_request_nr >= sc->stripes);

--- 53 unchanged lines hidden (view full) ---

337 for (i = 0; i < sc->stripes; i++)
338 DMEMIT(" %s %llu", sc->stripe[i].dev->name,
339 (unsigned long long)sc->stripe[i].physical_start);
340 break;
341 }
342 return 0;
343}
344
275{
276 struct stripe_c *sc = ti->private;
277 uint32_t stripe;
278 unsigned target_request_nr;
279
280 if (bio->bi_rw & REQ_FLUSH) {
281 target_request_nr = dm_bio_get_target_request_nr(bio);
282 BUG_ON(target_request_nr >= sc->stripes);

--- 53 unchanged lines hidden (view full) ---

336 for (i = 0; i < sc->stripes; i++)
337 DMEMIT(" %s %llu", sc->stripe[i].dev->name,
338 (unsigned long long)sc->stripe[i].physical_start);
339 break;
340 }
341 return 0;
342}
343
345static int stripe_end_io(struct dm_target *ti, struct bio *bio,
346 int error, union map_info *map_context)
344static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
347{
348 unsigned i;
349 char major_minor[16];
350 struct stripe_c *sc = ti->private;
351
352 if (!error)
353 return 0; /* I/O complete */
354

--- 105 unchanged lines hidden ---
345{
346 unsigned i;
347 char major_minor[16];
348 struct stripe_c *sc = ti->private;
349
350 if (!error)
351 return 0; /* I/O complete */
352

--- 105 unchanged lines hidden ---