From: Hannes Reinecke <hare@suse.de>
Date: Tue, 14 Jan 2020 10:30:48 +0100
Subject: [PATCH] kABI fixup for alloc_dax_region
Patch-mainline: Never, KABI fixup
References: bsc#1158071,bsc#1160678
KABI fixup for alloc_dax_region() due to added target_node parameter.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
drivers/dax/dax-private.h | 5 +++--
drivers/dax/device-dax.h | 5 ++++-
drivers/dax/device.c | 11 ++++++++++-
drivers/dax/pmem.c | 2 +-
drivers/nvdimm/nd.h | 5 ++++-
include/linux/libnvdimm.h | 4 +++-
6 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/drivers/dax/dax-private.h b/drivers/dax/dax-private.h
index 75d5410278ae..7441e5ee3e04 100644
--- a/drivers/dax/dax-private.h
+++ b/drivers/dax/dax-private.h
@@ -34,8 +34,10 @@ struct dax_region {
struct kref kref;
struct device *dev;
unsigned int align;
- struct resource res;
+#ifndef __GENKSYMS__
int target_node;
+#endif
+ struct resource res;
unsigned long pfn_flags;
};
@@ -52,7 +54,6 @@ struct dax_region {
struct dev_dax {
struct dax_region *region;
struct dax_device *dax_dev;
- int target_node;
struct device dev;
int id;
int num_resources;
diff --git a/drivers/dax/device-dax.h b/drivers/dax/device-dax.h
index 5ea4cafc4940..366c719c1b93 100644
--- a/drivers/dax/device-dax.h
+++ b/drivers/dax/device-dax.h
@@ -17,9 +17,12 @@ struct dev_dax;
struct resource;
struct dax_region;
void dax_region_put(struct dax_region *dax_region);
-struct dax_region *alloc_dax_region(struct device *parent,
+struct dax_region *__alloc_dax_region(struct device *parent,
int region_id, struct resource *res, int target_node, unsigned int align,
void *addr, unsigned long flags);
+struct dax_region *alloc_dax_region(struct device *parent,
+ int region_id, struct resource *res, unsigned int align,
+ void *addr, unsigned long flags);
struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region,
int id, struct resource *res, int count);
#endif /* __DEVICE_DAX_H__ */
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index 8d20071c1392..ab9a7974f850 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -99,7 +99,7 @@ static void dax_region_unregister(void *region)
dax_region_put(dax_region);
}
-struct dax_region *alloc_dax_region(struct device *parent, int region_id,
+struct dax_region *__alloc_dax_region(struct device *parent, int region_id,
struct resource *res, int target_node, unsigned int align, void *addr,
unsigned long pfn_flags)
{
@@ -142,6 +142,15 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
return NULL;
return dax_region;
}
+EXPORT_SYMBOL_GPL(__alloc_dax_region);
+
+struct dax_region *alloc_dax_region(struct device *parent, int region_id,
+ struct resource *res, unsigned int align, void *addr,
+ unsigned long pfn_flags)
+{
+ return __alloc_dax_region(parent, region_id, res, NUMA_NO_NODE,
+ align, addr, pfn_flags);
+}
EXPORT_SYMBOL_GPL(alloc_dax_region);
static struct dev_dax *to_dev_dax(struct device *dev)
diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c
index 29496f4e1454..54d52c8438b2 100644
--- a/drivers/dax/pmem.c
+++ b/drivers/dax/pmem.c
@@ -133,7 +133,7 @@ static int dax_pmem_probe(struct device *dev)
if (rc != 2)
return -EINVAL;
- dax_region = alloc_dax_region(dev, region_id, &res, nd_region->target_node,
+ dax_region = __alloc_dax_region(dev, region_id, &res, nd_region->target_node,
le32_to_cpu(pfn_sb->align), addr, PFN_DEV|PFN_MAP);
if (!dax_region)
return -ENOMEM;
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h
index 104471bc1277..0d5240da0d74 100644
--- a/drivers/nvdimm/nd.h
+++ b/drivers/nvdimm/nd.h
@@ -155,9 +155,12 @@ struct nd_region {
struct device *pfn_seed;
struct device *dax_seed;
u16 ndr_mappings;
+#ifndef __GENKSYMS__
+ int target_node;
+#endif
u64 ndr_size;
u64 ndr_start;
- int id, num_lanes, ro, numa_node, target_node;
+ int id, num_lanes, ro, numa_node;
void *provider_data;
struct kernfs_node *bb_state;
struct badblocks bb;
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 4b2b157c8fbe..b2e4b3480981 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -123,12 +123,14 @@ struct nd_region_desc {
struct resource *res;
struct nd_mapping_desc *mapping;
u16 num_mappings;
+#ifndef __GENKSYMS__
+ int target_node;
+#endif
const struct attribute_group **attr_groups;
struct nd_interleave_set *nd_set;
void *provider_data;
int num_lanes;
int numa_node;
- int target_node;
unsigned long flags;
struct device_node *of_node;
};
--
2.16.4