#include <linux/memremap.h>
#include <linux/pagemap.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/pfn_t.h>
#include <linux/cdev.h>
#include <linux/slab.h>
#include <linux/dax.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include "dax-private.h"
#include "bus.h"
static int check_vma(struct dev_dax *dev_dax, struct vm_area_struct *vma,
const char *func)
{ … }
__weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
unsigned long size)
{ … }
static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn,
unsigned long fault_size)
{ … }
static vm_fault_t __dev_dax_pte_fault(struct dev_dax *dev_dax,
struct vm_fault *vmf)
{ … }
static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax,
struct vm_fault *vmf)
{ … }
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax,
struct vm_fault *vmf)
{ … }
#else
static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax,
struct vm_fault *vmf)
{
return VM_FAULT_FALLBACK;
}
#endif
static vm_fault_t dev_dax_huge_fault(struct vm_fault *vmf, unsigned int order)
{ … }
static vm_fault_t dev_dax_fault(struct vm_fault *vmf)
{ … }
static int dev_dax_may_split(struct vm_area_struct *vma, unsigned long addr)
{ … }
static unsigned long dev_dax_pagesize(struct vm_area_struct *vma)
{ … }
static const struct vm_operations_struct dax_vm_ops = …;
static int dax_mmap(struct file *filp, struct vm_area_struct *vma)
{ … }
static unsigned long dax_get_unmapped_area(struct file *filp,
unsigned long addr, unsigned long len, unsigned long pgoff,
unsigned long flags)
{ … }
static const struct address_space_operations dev_dax_aops = …;
static int dax_open(struct inode *inode, struct file *filp)
{ … }
static int dax_release(struct inode *inode, struct file *filp)
{ … }
static const struct file_operations dax_fops = …;
static void dev_dax_cdev_del(void *cdev)
{ … }
static void dev_dax_kill(void *dev_dax)
{ … }
static int dev_dax_probe(struct dev_dax *dev_dax)
{ … }
static struct dax_device_driver device_dax_driver = …;
static int __init dax_init(void)
{ … }
static void __exit dax_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(dax_exit);
MODULE_ALIAS_DAX_DEVICE(…);