From: Pankaj Gupta <pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org,
linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org
Cc: kwolf-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
jack-AlSwsSmVLrQ@public.gmane.org,
xiaoguangrong.eric-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
riel-ebMLmSuQjDVBDgjK7y7TUQ@public.gmane.org,
niteshnarayanlal-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org,
david-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
ross.zwisler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
lcapitulino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
stefanha-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
imammedo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
nilal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
eblake-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: [PATCH 1/3] nd: move nd_region to common header
Date: Fri, 31 Aug 2018 19:00:16 +0530 [thread overview]
Message-ID: <20180831133019.27579-2-pagupta@redhat.com> (raw)
In-Reply-To: <20180831133019.27579-1-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
This patch moves nd_region definition to common header
include/linux/nd.h file. This is required for flush callback
support for both virtio-pmem & pmem driver.
Signed-off-by: Pankaj Gupta <pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
drivers/nvdimm/nd.h | 39 ---------------------------------------
include/linux/nd.h | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 39 deletions(-)
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h
index 98317e7..d079a2b 100644
--- a/drivers/nvdimm/nd.h
+++ b/drivers/nvdimm/nd.h
@@ -123,45 +123,6 @@ enum nd_mapping_lock_class {
ND_MAPPING_UUID_SCAN,
};
-struct nd_mapping {
- struct nvdimm *nvdimm;
- u64 start;
- u64 size;
- int position;
- struct list_head labels;
- struct mutex lock;
- /*
- * @ndd is for private use at region enable / disable time for
- * get_ndd() + put_ndd(), all other nd_mapping to ndd
- * conversions use to_ndd() which respects enabled state of the
- * nvdimm.
- */
- struct nvdimm_drvdata *ndd;
-};
-
-struct nd_region {
- struct device dev;
- struct ida ns_ida;
- struct ida btt_ida;
- struct ida pfn_ida;
- struct ida dax_ida;
- unsigned long flags;
- struct device *ns_seed;
- struct device *btt_seed;
- struct device *pfn_seed;
- struct device *dax_seed;
- u16 ndr_mappings;
- u64 ndr_size;
- u64 ndr_start;
- int id, num_lanes, ro, numa_node;
- void *provider_data;
- struct kernfs_node *bb_state;
- struct badblocks bb;
- struct nd_interleave_set *nd_set;
- struct nd_percpu_lane __percpu *lane;
- struct nd_mapping mapping[0];
-};
-
struct nd_blk_region {
int (*enable)(struct nvdimm_bus *nvdimm_bus, struct device *dev);
int (*do_io)(struct nd_blk_region *ndbr, resource_size_t dpa,
diff --git a/include/linux/nd.h b/include/linux/nd.h
index 43c181a..b9da9f7 100644
--- a/include/linux/nd.h
+++ b/include/linux/nd.h
@@ -120,6 +120,46 @@ struct nd_namespace_blk {
struct resource **res;
};
+struct nd_mapping {
+ struct nvdimm *nvdimm;
+ u64 start;
+ u64 size;
+ int position;
+ struct list_head labels;
+ struct mutex lock;
+ /*
+ * @ndd is for private use at region enable / disable time for
+ * get_ndd() + put_ndd(), all other nd_mapping to ndd
+ * conversions use to_ndd() which respects enabled state of the
+ * nvdimm.
+ */
+ struct nvdimm_drvdata *ndd;
+};
+
+struct nd_region {
+ struct device dev;
+ struct ida ns_ida;
+ struct ida btt_ida;
+ struct ida pfn_ida;
+ struct ida dax_ida;
+ unsigned long flags;
+ struct device *ns_seed;
+ struct device *btt_seed;
+ struct device *pfn_seed;
+ struct device *dax_seed;
+ u16 ndr_mappings;
+ u64 ndr_size;
+ u64 ndr_start;
+ int id, num_lanes, ro, numa_node;
+ void *provider_data;
+ struct kernfs_node *bb_state;
+ struct badblocks bb;
+ struct nd_interleave_set *nd_set;
+ struct nd_percpu_lane __percpu *lane;
+ int (*flush)(struct nd_region *nd_region);
+ struct nd_mapping mapping[0];
+};
+
static inline struct nd_namespace_io *to_nd_namespace_io(const struct device *dev)
{
return container_of(dev, struct nd_namespace_io, common.dev);
--
2.9.3
next prev parent reply other threads:[~2018-08-31 13:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 13:30 [PATCH 0/3] kvm "fake DAX" device Pankaj Gupta
[not found] ` <20180831133019.27579-1-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-08-31 13:30 ` Pankaj Gupta [this message]
[not found] ` <20180831133019.27579-2-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-22 0:47 ` [PATCH 1/3] nd: move nd_region to common header Dan Williams
[not found] ` <CAPcyv4jFimkVnVuzza5TCG=KvY88KZnXzH4GNEgUBbTouprzJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-24 11:40 ` Pankaj Gupta
2018-08-31 13:30 ` [PATCH 2/3] libnvdimm: nd_region flush callback support Pankaj Gupta
2018-09-04 15:29 ` kbuild test robot
[not found] ` <20180904152917.GE17047-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-09-05 8:40 ` Pankaj Gupta
2018-09-22 0:43 ` Dan Williams
2018-09-24 11:07 ` Pankaj Gupta
2018-08-31 13:30 ` [PATCH 3/3] virtio-pmem: Add virtio pmem driver Pankaj Gupta
[not found] ` <20180831133019.27579-4-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-04 15:17 ` kbuild test robot
2018-09-05 8:34 ` Pankaj Gupta
2018-09-05 12:02 ` kbuild test robot
2018-09-12 16:54 ` Luiz Capitulino
2018-09-13 6:58 ` [Qemu-devel] " Pankaj Gupta
[not found] ` <831225077.12817716.1536821901550.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-13 12:19 ` Luiz Capitulino
2018-09-14 12:13 ` Pankaj Gupta
2018-09-22 1:08 ` Dan Williams
2018-09-24 9:41 ` Pankaj Gupta
2018-09-27 13:06 ` Pankaj Gupta
2018-09-27 15:55 ` Dan Williams
2018-08-31 13:30 ` [PATCH] qemu: Add virtio pmem device Pankaj Gupta
[not found] ` <20180831133019.27579-5-pagupta-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-12 16:57 ` Luiz Capitulino
2018-09-13 7:06 ` Pankaj Gupta
[not found] ` <563893075.12819183.1536822387535.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-13 12:22 ` Luiz Capitulino
2018-09-20 11:21 ` David Hildenbrand
[not found] ` <2721c3ee-88d1-a8e9-1f1e-ffc3eef1d1ca-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-20 12:03 ` [Qemu-devel] " Pankaj Gupta
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=20180831133019.27579-2-pagupta@redhat.com \
--to=pagupta-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=david-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=eblake-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=imammedo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jack-AlSwsSmVLrQ@public.gmane.org \
--cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kwolf-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=lcapitulino-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org \
--cc=mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=nilal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=niteshnarayanlal-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org \
--cc=pbonzini-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org \
--cc=riel-ebMLmSuQjDVBDgjK7y7TUQ@public.gmane.org \
--cc=ross.zwisler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=stefanha-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=xiaoguangrong.eric-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).