#define pr_fmt(fmt) …
#define MTD_DEFAULT_TIMEOUT …
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/bio.h>
#include <linux/pagemap.h>
#include <linux/list.h>
#include <linux/init.h>
#include <linux/mtd/mtd.h>
#include <linux/mutex.h>
#include <linux/mount.h>
#include <linux/slab.h>
#include <linux/major.h>
#define BLOCK2MTD_PARAM_MAX_COUNT …
struct block2mtd_dev { … };
static LIST_HEAD(blkmtd_device_list);
static struct page *page_read(struct address_space *mapping, pgoff_t index)
{ … }
static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len)
{ … }
static int block2mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
{ … }
static int block2mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
{ … }
static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf,
loff_t to, size_t len, size_t *retlen)
{ … }
static int block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{ … }
static void block2mtd_sync(struct mtd_info *mtd)
{ … }
static void block2mtd_free_device(struct block2mtd_dev *dev)
{ … }
static struct file __ref *mdtblock_early_get_bdev(const char *devname,
blk_mode_t mode, int timeout, struct block2mtd_dev *dev)
{ … }
static struct block2mtd_dev *add_device(char *devname, int erase_size,
char *label, int timeout)
{ … }
static int ustrtoul(const char *cp, char **endp, unsigned int base)
{ … }
static int parse_num(size_t *num, const char *token)
{ … }
static inline void kill_final_newline(char *str)
{ … }
#ifndef MODULE
static int block2mtd_init_called = …;
static char block2mtd_paramline[80 + 12];
#endif
static int block2mtd_setup2(const char *val)
{ … }
static int block2mtd_setup(const char *val, const struct kernel_param *kp)
{ … }
module_param_call(…);
MODULE_PARM_DESC(…) …;
static int __init block2mtd_init(void)
{ … }
static void block2mtd_exit(void)
{ … }
late_initcall(block2mtd_init);
module_exit(block2mtd_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;