#include "dm.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/bio.h>
#include <linux/dax.h>
#include <linux/slab.h>
#include <linux/device-mapper.h>
#define DM_MSG_PREFIX …
struct linear_c { … };
static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
{ … }
static void linear_dtr(struct dm_target *ti)
{ … }
static sector_t linear_map_sector(struct dm_target *ti, sector_t bi_sector)
{ … }
int linear_map(struct dm_target *ti, struct bio *bio)
{ … }
static void linear_status(struct dm_target *ti, status_type_t type,
unsigned int status_flags, char *result, unsigned int maxlen)
{ … }
static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
{ … }
#ifdef CONFIG_BLK_DEV_ZONED
static int linear_report_zones(struct dm_target *ti,
struct dm_report_zones_args *args, unsigned int nr_zones)
{ … }
#else
#define linear_report_zones …
#endif
static int linear_iterate_devices(struct dm_target *ti,
iterate_devices_callout_fn fn, void *data)
{ … }
#if IS_ENABLED(CONFIG_FS_DAX)
static struct dax_device *linear_dax_pgoff(struct dm_target *ti, pgoff_t *pgoff)
{ … }
static long linear_dax_direct_access(struct dm_target *ti, pgoff_t pgoff,
long nr_pages, enum dax_access_mode mode, void **kaddr,
pfn_t *pfn)
{ … }
static int linear_dax_zero_page_range(struct dm_target *ti, pgoff_t pgoff,
size_t nr_pages)
{ … }
static size_t linear_dax_recovery_write(struct dm_target *ti, pgoff_t pgoff,
void *addr, size_t bytes, struct iov_iter *i)
{ … }
#else
#define linear_dax_direct_access …
#define linear_dax_zero_page_range …
#define linear_dax_recovery_write …
#endif
static struct target_type linear_target = …;
int __init dm_linear_init(void)
{ … }
void dm_linear_exit(void)
{ … }