#include <linux/scatterlist.h>
#include <linux/memregion.h>
#include <linux/highmem.h>
#include <linux/kstrtox.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/hash.h>
#include <linux/sort.h>
#include <linux/io.h>
#include <linux/nd.h>
#include "nd-core.h"
#include "nd.h"
#include <linux/io-64-nonatomic-hi-lo.h>
static DEFINE_PER_CPU(int, flush_idx);
static int nvdimm_map_flush(struct device *dev, struct nvdimm *nvdimm, int dimm,
struct nd_region_data *ndrd)
{ … }
static int nd_region_invalidate_memregion(struct nd_region *nd_region)
{ … }
int nd_region_activate(struct nd_region *nd_region)
{ … }
static void nd_region_release(struct device *dev)
{ … }
struct nd_region *to_nd_region(struct device *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
struct device *nd_region_dev(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
void *nd_region_provider_data(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
int nd_region_to_nstype(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL(…);
static unsigned long long region_size(struct nd_region *nd_region)
{ … }
static ssize_t size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(size);
static ssize_t deep_flush_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t deep_flush_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static DEVICE_ATTR_RW(deep_flush);
static ssize_t mappings_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(mappings);
static ssize_t nstype_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(nstype);
static ssize_t set_cookie_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(set_cookie);
resource_size_t nd_region_available_dpa(struct nd_region *nd_region)
{ … }
resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region)
{ … }
static ssize_t available_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(available_size);
static ssize_t max_available_extent_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(max_available_extent);
static ssize_t init_namespaces_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(init_namespaces);
static ssize_t namespace_seed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(namespace_seed);
static ssize_t btt_seed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(btt_seed);
static ssize_t pfn_seed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(pfn_seed);
static ssize_t dax_seed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(dax_seed);
static ssize_t read_only_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static int revalidate_read_only(struct device *dev, void *data)
{ … }
static ssize_t read_only_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len)
{ … }
static DEVICE_ATTR_RW(read_only);
static ssize_t align_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t align_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len)
{ … }
static DEVICE_ATTR_RW(align);
static ssize_t region_badblocks_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(badblocks, 0444, region_badblocks_show, NULL);
static ssize_t resource_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_ADMIN_RO(resource);
static ssize_t persistence_domain_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(persistence_domain);
static struct attribute *nd_region_attributes[] = …;
static umode_t region_visible(struct kobject *kobj, struct attribute *a, int n)
{ … }
static ssize_t mappingN(struct device *dev, char *buf, int n)
{ … }
#define REGION_MAPPING(idx) …
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
REGION_MAPPING(…);
static umode_t mapping_visible(struct kobject *kobj, struct attribute *a, int n)
{ … }
static struct attribute *mapping_attributes[] = …;
static const struct attribute_group nd_mapping_attribute_group = …;
static const struct attribute_group nd_region_attribute_group = …;
static const struct attribute_group *nd_region_attribute_groups[] = …;
static const struct device_type nd_pmem_device_type = …;
static const struct device_type nd_volatile_device_type = …;
bool is_nd_pmem(const struct device *dev)
{ … }
bool is_nd_volatile(const struct device *dev)
{ … }
u64 nd_region_interleave_set_cookie(struct nd_region *nd_region,
struct nd_namespace_index *nsindex)
{ … }
u64 nd_region_interleave_set_altcookie(struct nd_region *nd_region)
{ … }
void nd_mapping_free_labels(struct nd_mapping *nd_mapping)
{ … }
void nd_region_advance_seeds(struct nd_region *nd_region, struct device *dev)
{ … }
unsigned int nd_region_acquire_lane(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL(…);
void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane)
{ … }
EXPORT_SYMBOL(…);
#define MEMREMAP_COMPAT_ALIGN_MAX …
static unsigned long default_align(struct nd_region *nd_region)
{ … }
static struct lock_class_key nvdimm_region_key;
static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus,
struct nd_region_desc *ndr_desc,
const struct device_type *dev_type, const char *caller)
{ … }
struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus,
struct nd_region_desc *ndr_desc)
{ … }
EXPORT_SYMBOL_GPL(…);
struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus,
struct nd_region_desc *ndr_desc)
{ … }
EXPORT_SYMBOL_GPL(…);
void nvdimm_region_delete(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
int nvdimm_flush(struct nd_region *nd_region, struct bio *bio)
{ … }
int generic_nvdimm_flush(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
int nvdimm_has_flush(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
int nvdimm_has_cache(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
bool is_nvdimm_sync(struct nd_region *nd_region)
{ … }
EXPORT_SYMBOL_GPL(…);
struct conflict_context { … };
static int region_conflict(struct device *dev, void *data)
{ … }
int nd_region_conflict(struct nd_region *nd_region, resource_size_t start,
resource_size_t size)
{ … }
MODULE_IMPORT_NS(…);