#include "dm-core.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/bio.h>
#include <linux/dax.h>
#define DM_MSG_PREFIX …
static LIST_HEAD(_targets);
static DECLARE_RWSEM(_lock);
static inline struct target_type *__find_target_type(const char *name)
{ … }
static struct target_type *get_target_type(const char *name)
{ … }
static void load_module(const char *name)
{ … }
struct target_type *dm_get_target_type(const char *name)
{ … }
void dm_put_target_type(struct target_type *tt)
{ … }
int dm_target_iterate(void (*iter_func)(struct target_type *tt,
void *param), void *param)
{ … }
int dm_register_target(struct target_type *tt)
{ … }
EXPORT_SYMBOL(…);
void dm_unregister_target(struct target_type *tt)
{ … }
EXPORT_SYMBOL(…);
struct io_err_c { … };
static int io_err_get_args(struct dm_target *tt, unsigned int argc, char **args)
{ … }
static int io_err_ctr(struct dm_target *tt, unsigned int argc, char **args)
{ … }
static void io_err_dtr(struct dm_target *tt)
{ … }
static int io_err_map(struct dm_target *tt, struct bio *bio)
{ … }
static int io_err_clone_and_map_rq(struct dm_target *ti, struct request *rq,
union map_info *map_context,
struct request **clone)
{ … }
static void io_err_release_clone_rq(struct request *clone,
union map_info *map_context)
{ … }
#ifdef CONFIG_BLK_DEV_ZONED
static sector_t io_err_map_sector(struct dm_target *ti, sector_t bi_sector)
{ … }
static int io_err_report_zones(struct dm_target *ti,
struct dm_report_zones_args *args, unsigned int nr_zones)
{ … }
#else
#define io_err_report_zones …
#endif
static int io_err_iterate_devices(struct dm_target *ti,
iterate_devices_callout_fn fn, void *data)
{ … }
static void io_err_io_hints(struct dm_target *ti, struct queue_limits *limits)
{ … }
static long io_err_dax_direct_access(struct dm_target *ti, pgoff_t pgoff,
long nr_pages, enum dax_access_mode mode, void **kaddr,
pfn_t *pfn)
{ … }
static struct target_type error_target = …;
int __init dm_target_init(void)
{ … }
void dm_target_exit(void)
{ … }