aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/nd-core.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-05-29 23:12:19 -0700
committerDan Williams <dan.j.williams@intel.com>2017-06-27 16:44:13 -0700
commitc9e582aa689f5418ca30e1e7a975039772c3a757 (patch)
tree34ea0b661819d2e80c80a2197ad264e55b0fffc6 /drivers/nvdimm/nd-core.h
parentlibnvdimm, pmem: fix persistence warning (diff)
downloadlinux-dev-c9e582aa689f5418ca30e1e7a975039772c3a757.tar.xz
linux-dev-c9e582aa689f5418ca30e1e7a975039772c3a757.zip
libnvdimm, nfit: enable support for volatile ranges
Allow volatile nfit ranges to participate in all the same infrastructure provided for persistent memory regions. A resulting resulting namespace device will still be called "pmem", but the parent region type will be "nd_volatile". This is in preparation for disabling the dax ->flush() operation in the pmem driver when it is hosted on a volatile range. Cc: Jan Kara <jack@suse.cz> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Matthew Wilcox <mawilcox@microsoft.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/nd-core.h')
-rw-r--r--drivers/nvdimm/nd-core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h
index 4c4bd209e725..86bc19ae30da 100644
--- a/drivers/nvdimm/nd-core.h
+++ b/drivers/nvdimm/nd-core.h
@@ -64,7 +64,16 @@ struct blk_alloc_info {
bool is_nvdimm(struct device *dev);
bool is_nd_pmem(struct device *dev);
+bool is_nd_volatile(struct device *dev);
bool is_nd_blk(struct device *dev);
+static inline bool is_nd_region(struct device *dev)
+{
+ return is_nd_pmem(dev) || is_nd_blk(dev) || is_nd_volatile(dev);
+}
+static inline bool is_memory(struct device *dev)
+{
+ return is_nd_pmem(dev) || is_nd_volatile(dev);
+}
struct nvdimm_bus *walk_to_nvdimm_bus(struct device *nd_dev);
int __init nvdimm_bus_init(void);
void nvdimm_bus_exit(void);