All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hpe.com>
To: snitzer@redhat.com
Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org,
	linux-raid@vger.kernel.org, dm-devel@redhat.com, agk@redhat.com
Subject: [PATCH 2/2] dm snap: add fake origin_direct_access
Date: Tue, 28 Jun 2016 13:37:16 -0600	[thread overview]
Message-ID: <1467142636-21094-3-git-send-email-toshi.kani@hpe.com> (raw)
In-Reply-To: <1467142636-21094-1-git-send-email-toshi.kani@hpe.com>

dax-capable mapped-device is marked as DM_TYPE_DAX_BIO_BASED,
which supports both dax and bio-based operations.  dm-snap
needs to work with dax-capable device when bio-based operation
is used.

Add fake origin_direct_access() to origin device so that its
origin device is also marked as DM_TYPE_DAX_BIO_BASED for
dax-capable device.  This allows to extend target's DM table.
dm-snap works normally when bio-based operation is used.

dm-snap does not support dax operation, and mount with dax
option to a target device or snapshot device fails.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
---
 drivers/md/dm-snap.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 69ab1ff..c472f04 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -2301,6 +2301,13 @@ static int origin_map(struct dm_target *ti, struct bio *bio)
 	return do_origin(o->dev, bio);
 }
 
+static long origin_direct_access(struct dm_target *ti, sector_t sector,
+		void __pmem **kaddr, pfn_t *pfn, long size)
+{
+	DMWARN("device does not support dax.");
+	return -EIO;
+}
+
 /*
  * Set the target "max_io_len" field to the minimum of all the snapshots'
  * chunk sizes.
@@ -2360,6 +2367,7 @@ static struct target_type origin_target = {
 	.postsuspend = origin_postsuspend,
 	.status  = origin_status,
 	.iterate_devices = origin_iterate_devices,
+	.direct_access = origin_direct_access,
 };
 
 static struct target_type snapshot_target = {
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: Toshi Kani <toshi.kani-ZPxbGqLxI0U@public.gmane.org>
To: snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: [PATCH 2/2] dm snap: add fake origin_direct_access
Date: Tue, 28 Jun 2016 13:37:16 -0600	[thread overview]
Message-ID: <1467142636-21094-3-git-send-email-toshi.kani@hpe.com> (raw)
In-Reply-To: <1467142636-21094-1-git-send-email-toshi.kani-ZPxbGqLxI0U@public.gmane.org>

dax-capable mapped-device is marked as DM_TYPE_DAX_BIO_BASED,
which supports both dax and bio-based operations.  dm-snap
needs to work with dax-capable device when bio-based operation
is used.

Add fake origin_direct_access() to origin device so that its
origin device is also marked as DM_TYPE_DAX_BIO_BASED for
dax-capable device.  This allows to extend target's DM table.
dm-snap works normally when bio-based operation is used.

dm-snap does not support dax operation, and mount with dax
option to a target device or snapshot device fails.

Signed-off-by: Toshi Kani <toshi.kani-ZPxbGqLxI0U@public.gmane.org>
Cc: Mike Snitzer <snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Alasdair Kergon <agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/md/dm-snap.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 69ab1ff..c472f04 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -2301,6 +2301,13 @@ static int origin_map(struct dm_target *ti, struct bio *bio)
 	return do_origin(o->dev, bio);
 }
 
+static long origin_direct_access(struct dm_target *ti, sector_t sector,
+		void __pmem **kaddr, pfn_t *pfn, long size)
+{
+	DMWARN("device does not support dax.");
+	return -EIO;
+}
+
 /*
  * Set the target "max_io_len" field to the minimum of all the snapshots'
  * chunk sizes.
@@ -2360,6 +2367,7 @@ static struct target_type origin_target = {
 	.postsuspend = origin_postsuspend,
 	.status  = origin_status,
 	.iterate_devices = origin_iterate_devices,
+	.direct_access = origin_direct_access,
 };
 
 static struct target_type snapshot_target = {

WARNING: multiple messages have this Message-ID (diff)
From: Toshi Kani <toshi.kani@hpe.com>
To: snitzer@redhat.com
Cc: agk@redhat.com, dan.j.williams@intel.com,
	linux-nvdimm@ml01.01.org, dm-devel@redhat.com,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	Toshi Kani <toshi.kani@hpe.com>
Subject: [PATCH 2/2] dm snap: add fake origin_direct_access
Date: Tue, 28 Jun 2016 13:37:16 -0600	[thread overview]
Message-ID: <1467142636-21094-3-git-send-email-toshi.kani@hpe.com> (raw)
In-Reply-To: <1467142636-21094-1-git-send-email-toshi.kani@hpe.com>

dax-capable mapped-device is marked as DM_TYPE_DAX_BIO_BASED,
which supports both dax and bio-based operations.  dm-snap
needs to work with dax-capable device when bio-based operation
is used.

Add fake origin_direct_access() to origin device so that its
origin device is also marked as DM_TYPE_DAX_BIO_BASED for
dax-capable device.  This allows to extend target's DM table.
dm-snap works normally when bio-based operation is used.

dm-snap does not support dax operation, and mount with dax
option to a target device or snapshot device fails.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
---
 drivers/md/dm-snap.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 69ab1ff..c472f04 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -2301,6 +2301,13 @@ static int origin_map(struct dm_target *ti, struct bio *bio)
 	return do_origin(o->dev, bio);
 }
 
+static long origin_direct_access(struct dm_target *ti, sector_t sector,
+		void __pmem **kaddr, pfn_t *pfn, long size)
+{
+	DMWARN("device does not support dax.");
+	return -EIO;
+}
+
 /*
  * Set the target "max_io_len" field to the minimum of all the snapshots'
  * chunk sizes.
@@ -2360,6 +2367,7 @@ static struct target_type origin_target = {
 	.postsuspend = origin_postsuspend,
 	.status  = origin_status,
 	.iterate_devices = origin_iterate_devices,
+	.direct_access = origin_direct_access,
 };
 
 static struct target_type snapshot_target = {

  parent reply	other threads:[~2016-06-28 19:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 19:37 [PATCH 0/2] Support DAX for device-mapper dm-linear devices Toshi Kani
2016-06-28 19:37 ` Toshi Kani
2016-06-28 19:37 ` Toshi Kani
2016-06-28 19:37 ` [PATCH 1/2] dm: update table type check for dax Toshi Kani
2016-06-28 19:37   ` Toshi Kani
2016-06-28 19:37   ` Toshi Kani
     [not found]   ` <1467142636-21094-2-git-send-email-toshi.kani-ZPxbGqLxI0U@public.gmane.org>
2016-06-28 20:07     ` Mike Snitzer
2016-06-28 20:07       ` Mike Snitzer
     [not found]       ` <20160628200714.GC8300-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-28 20:23         ` Kani, Toshimitsu
2016-06-28 20:23           ` Kani, Toshimitsu
     [not found]           ` <1467145398.3504.439.camel-ZPxbGqLxI0U@public.gmane.org>
2016-06-29  0:40             ` Mike Snitzer
2016-06-29  0:40               ` Mike Snitzer
     [not found]               ` <20160629004049.GA9721-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-06-29 15:19                 ` Kani, Toshimitsu
2016-06-29 15:19                   ` Kani, Toshimitsu
2016-06-28 20:33   ` kbuild test robot
2016-06-28 20:33     ` kbuild test robot
2016-06-28 20:33     ` kbuild test robot
2016-06-28 19:37 ` Toshi Kani [this message]
2016-06-28 19:37   ` [PATCH 2/2] dm snap: add fake origin_direct_access Toshi Kani
2016-06-28 19:37   ` Toshi Kani
2016-06-28 20:27   ` kbuild test robot
2016-06-28 20:27     ` kbuild test robot
2016-06-28 20:27     ` kbuild test robot
2016-06-28 19:43 ` [PATCH 0/2] fix dm-snap for dax Kani, Toshimitsu
2016-06-28 19:43   ` Kani, Toshimitsu
2016-06-28 19:43   ` Kani, Toshimitsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467142636-21094-3-git-send-email-toshi.kani@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.