[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1410220931460.31351@file01.intranet.prod.int.rdu2.redhat.com>
Date: Wed, 22 Oct 2014 09:32:09 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: "Alasdair G. Kergon" <agk@...hat.com>,
Mike Snitzer <msnitzer@...hat.com>,
Jonathan Brassow <jbrassow@...hat.com>,
Edward Thornber <thornber@...hat.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@...radead.org>
cc: dm-devel@...hat.com, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
Subject: [PATCH 14/18] dm stripe: support copy
Support the copy operation for the stripe target.
In stripe_merge, we verify that the underlying device supports copy. If it
doesn't, we can fail fast without any bio being contructed.
Signed-off-by: Mikulas Patocka <mpatocka@...hat.com>
---
drivers/md/dm-stripe.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
Index: linux-3.16-rc4/drivers/md/dm-stripe.c
===================================================================
--- linux-3.16-rc4.orig/drivers/md/dm-stripe.c 2014-07-11 22:20:25.000000000 +0200
+++ linux-3.16-rc4/drivers/md/dm-stripe.c 2014-07-11 22:23:54.000000000 +0200
@@ -165,6 +165,7 @@ static int stripe_ctr(struct dm_target *
ti->num_flush_bios = stripes;
ti->num_discard_bios = stripes;
ti->num_write_same_bios = stripes;
+ ti->copy_supported = 1;
sc->chunk_size = chunk_size;
if (chunk_size & (chunk_size - 1))
@@ -416,11 +417,19 @@ static int stripe_merge(struct dm_target
struct stripe_c *sc = ti->private;
sector_t bvm_sector = bvm->bi_sector;
uint32_t stripe;
+ struct block_device *bdev;
struct request_queue *q;
stripe_map_sector(sc, bvm_sector, &stripe, &bvm_sector);
- q = bdev_get_queue(sc->stripe[stripe].dev->bdev);
+ bdev = sc->stripe[stripe].dev->bdev;
+
+ if (unlikely((bvm->bi_rw & REQ_COPY) != 0)) {
+ if (!bdev_copy_offload(bdev))
+ return 0;
+ }
+
+ q = bdev_get_queue(bdev);
if (!q->merge_bvec_fn)
return max_size;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists