All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm stripe: add DAX support
@ 2016-06-24 18:23 ` Toshi Kani
  0 siblings, 0 replies; 26+ messages in thread
From: Toshi Kani @ 2016-06-24 18:23 UTC (permalink / raw)
  To: snitzer; +Cc: linux-nvdimm, linux-kernel, linux-raid, dm-devel, Alasdair Kergon

Change dm-stripe to implement direct_access function,
stripe_direct_access(), which maps bdev and sector and
calls direct_access function of its physical target device.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
---
 drivers/md/dm-stripe.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 48f1c01..8925f6a 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -308,6 +308,30 @@ static int stripe_map(struct dm_target *ti, struct bio *bio)
 	return DM_MAPIO_REMAPPED;
 }
 
+static long stripe_direct_access(struct dm_target *ti, sector_t sector,
+		void __pmem **kaddr, pfn_t *pfn, long size)
+{
+	struct stripe_c *sc;
+	struct block_device *bdev;
+	uint32_t stripe;
+	struct blk_dax_ctl dax = {
+		.size = size,
+	};
+	long ret;
+
+	sc = ti->private;
+	stripe_map_sector(sc, sector, &stripe, &dax.sector);
+
+	dax.sector += sc->stripe[stripe].physical_start;
+	bdev = sc->stripe[stripe].dev->bdev;
+
+	ret = bdev_direct_access(bdev, &dax);
+	*kaddr = dax.addr;
+	*pfn = dax.pfn;
+
+	return ret;
+}
+
 /*
  * Stripe status:
  *
@@ -425,6 +449,7 @@ static struct target_type stripe_target = {
 	.status = stripe_status,
 	.iterate_devices = stripe_iterate_devices,
 	.io_hints = stripe_io_hints,
+	.direct_access = stripe_direct_access,
 };
 
 int __init dm_stripe_init(void)
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-07-21  3:03 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-24 18:23 [PATCH] dm stripe: add DAX support Toshi Kani
2016-06-24 18:23 ` Toshi Kani
2016-06-24 18:23 ` Toshi Kani
2016-06-24 18:29 ` Mike Snitzer
     [not found]   ` <20160624182859.GD13898-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-24 18:42     ` Kani, Toshimitsu
2016-06-24 18:42       ` Kani, Toshimitsu
2016-07-12 22:22     ` Kani, Toshimitsu
2016-07-12 22:22       ` Kani, Toshimitsu
     [not found]       ` <1468362104.8908.43.camel-ZPxbGqLxI0U@public.gmane.org>
2016-07-13  2:01         ` Mike Snitzer
2016-07-13  2:01           ` Mike Snitzer
     [not found]           ` <20160713020100.GA5872-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-13 15:03             ` Kani, Toshimitsu
2016-07-13 15:03               ` Kani, Toshimitsu
     [not found]               ` <1468422189.8908.53.camel-ZPxbGqLxI0U@public.gmane.org>
2016-07-21  0:01                 ` Mike Snitzer
2016-07-21  0:01                   ` Mike Snitzer
     [not found]                   ` <20160721000142.GA21913-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-07-21  3:03                     ` Jens Axboe
2016-07-21  3:03                       ` Jens Axboe
2016-06-24 19:58 ` [PATCH] " kbuild test robot
2016-06-24 19:58   ` kbuild test robot
2016-06-24 19:58   ` kbuild test robot
     [not found]   ` <201606250312.OzHHesq4%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-24 20:02     ` Mike Snitzer
2016-06-24 20:02       ` Mike Snitzer
     [not found]       ` <20160624200239.GA15587-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-24 20:46         ` Kani, Toshimitsu
2016-06-24 20:46           ` Kani, Toshimitsu
2016-06-24 19:59 ` [PATCH] " kbuild test robot
2016-06-24 19:59   ` kbuild test robot
2016-06-24 19:59   ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.