#include <linux/memremap.h>
#include <linux/pagemap.h>
#include <linux/memory.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/pfn_t.h>
#include <linux/slab.h>
#include <linux/dax.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/memory-tiers.h>
#include <linux/memory_hotplug.h>
#include "dax-private.h"
#include "bus.h"
#define MEMTIER_DEFAULT_DAX_ADISTANCE …
static const char *kmem_name;
static bool any_hotremove_failed;
static int dax_kmem_range(struct dev_dax *dev_dax, int i, struct range *r)
{ … }
struct dax_kmem_data { … };
static DEFINE_MUTEX(kmem_memory_type_lock);
static LIST_HEAD(kmem_memory_types);
static struct memory_dev_type *kmem_find_alloc_memory_type(int adist)
{ … }
static void kmem_put_memory_types(void)
{ … }
static int dev_dax_kmem_probe(struct dev_dax *dev_dax)
{ … }
#ifdef CONFIG_MEMORY_HOTREMOVE
static void dev_dax_kmem_remove(struct dev_dax *dev_dax)
{ … }
#else
static void dev_dax_kmem_remove(struct dev_dax *dev_dax)
{
any_hotremove_failed = true;
}
#endif
static struct dax_device_driver device_dax_kmem_driver = …;
static int __init dax_kmem_init(void)
{ … }
static void __exit dax_kmem_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(dax_kmem_exit);
MODULE_ALIAS_DAX_DEVICE(…);