#include <linux/pagemap.h>
#include <linux/module.h>
#include <linux/mount.h>
#include <linux/pseudo_fs.h>
#include <linux/magic.h>
#include <linux/pfn_t.h>
#include <linux/cdev.h>
#include <linux/slab.h>
#include <linux/uio.h>
#include <linux/dax.h>
#include <linux/fs.h>
#include <linux/cacheinfo.h>
#include "dax-private.h"
struct dax_device { … };
static dev_t dax_devt;
DEFINE_STATIC_SRCU(…);
static struct vfsmount *dax_mnt;
static DEFINE_IDA(dax_minor_ida);
static struct kmem_cache *dax_cache __read_mostly;
static struct super_block *dax_superblock __read_mostly;
int dax_read_lock(void)
{ … }
EXPORT_SYMBOL_GPL(…);
void dax_read_unlock(int id)
{ … }
EXPORT_SYMBOL_GPL(…);
#if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX)
#include <linux/blkdev.h>
static DEFINE_XARRAY(dax_hosts);
int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk)
{ … }
EXPORT_SYMBOL_GPL(…);
void dax_remove_host(struct gendisk *disk)
{ … }
EXPORT_SYMBOL_GPL(…);
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start_off,
void *holder, const struct dax_holder_operations *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
void fs_put_dax(struct dax_device *dax_dev, void *holder)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
enum dax_device_flags { … };
long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
enum dax_access_mode mode, void **kaddr, pfn_t *pfn)
{ … }
EXPORT_SYMBOL_GPL(…);
size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
size_t bytes, struct iov_iter *i)
{ … }
size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
size_t bytes, struct iov_iter *i)
{ … }
int dax_zero_page_range(struct dax_device *dax_dev, pgoff_t pgoff,
size_t nr_pages)
{ … }
EXPORT_SYMBOL_GPL(…);
size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff,
void *addr, size_t bytes, struct iov_iter *iter)
{ … }
EXPORT_SYMBOL_GPL(…);
int dax_holder_notify_failure(struct dax_device *dax_dev, u64 off,
u64 len, int mf_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_ARCH_HAS_PMEM_API
void arch_wb_cache_pmem(void *addr, size_t size);
void dax_flush(struct dax_device *dax_dev, void *addr, size_t size)
{ … }
#else
void dax_flush(struct dax_device *dax_dev, void *addr, size_t size)
{
}
#endif
EXPORT_SYMBOL_GPL(…);
void dax_write_cache(struct dax_device *dax_dev, bool wc)
{ … }
EXPORT_SYMBOL_GPL(…);
bool dax_write_cache_enabled(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
bool dax_synchronous(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void set_dax_synchronous(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void set_dax_nocache(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void set_dax_nomc(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
bool dax_alive(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void kill_dax(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void run_dax(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct inode *dax_alloc_inode(struct super_block *sb)
{ … }
static struct dax_device *to_dax_dev(struct inode *inode)
{ … }
static void dax_free_inode(struct inode *inode)
{ … }
static void dax_destroy_inode(struct inode *inode)
{ … }
static const struct super_operations dax_sops = …;
static int dax_init_fs_context(struct fs_context *fc)
{ … }
static struct file_system_type dax_fs_type = …;
static int dax_test(struct inode *inode, void *data)
{ … }
static int dax_set(struct inode *inode, void *data)
{ … }
static struct dax_device *dax_dev_get(dev_t devt)
{ … }
struct dax_device *alloc_dax(void *private, const struct dax_operations *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
void put_dax(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void *dax_holder(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
struct dax_device *inode_dax(struct inode *inode)
{ … }
EXPORT_SYMBOL_GPL(…);
struct inode *dax_inode(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void *dax_get_private(struct dax_device *dax_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static void init_once(void *_dax_dev)
{ … }
static int dax_fs_init(void)
{ … }
static void dax_fs_exit(void)
{ … }
static int __init dax_core_init(void)
{ … }
static void __exit dax_core_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
subsys_initcall(dax_core_init);
module_exit(dax_core_exit);