#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/mtd/ubi.h>
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
#include <linux/hdreg.h>
#include <linux/scatterlist.h>
#include <linux/idr.h>
#include <asm/div64.h>
#include "ubi-media.h"
#include "ubi.h"
#define UBIBLOCK_MAX_DEVICES …
#define UBIBLOCK_PARAM_LEN …
#define UBIBLOCK_PARAM_COUNT …
struct ubiblock_param { … };
struct ubiblock_pdu { … };
static int ubiblock_devs;
static struct ubiblock_param ubiblock_param[UBIBLOCK_MAX_DEVICES];
struct ubiblock { … };
static LIST_HEAD(ubiblock_devices);
static DEFINE_IDR(ubiblock_minor_idr);
static DEFINE_MUTEX(devices_mutex);
static int ubiblock_major;
static int __init ubiblock_set_param(const char *val,
const struct kernel_param *kp)
{ … }
static const struct kernel_param_ops ubiblock_param_ops = …;
module_param_cb(…);
MODULE_PARM_DESC(…) …;
static struct ubiblock *find_dev_nolock(int ubi_num, int vol_id)
{ … }
static blk_status_t ubiblock_read(struct request *req)
{ … }
static int ubiblock_open(struct gendisk *disk, blk_mode_t mode)
{ … }
static void ubiblock_release(struct gendisk *gd)
{ … }
static int ubiblock_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{ … }
static const struct block_device_operations ubiblock_ops = …;
static blk_status_t ubiblock_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{ … }
static int ubiblock_init_request(struct blk_mq_tag_set *set,
struct request *req, unsigned int hctx_idx,
unsigned int numa_node)
{ … }
static const struct blk_mq_ops ubiblock_mq_ops = …;
static int calc_disk_capacity(struct ubi_volume_info *vi, u64 *disk_capacity)
{ … }
int ubiblock_create(struct ubi_volume_info *vi)
{ … }
static void ubiblock_cleanup(struct ubiblock *dev)
{ … }
int ubiblock_remove(struct ubi_volume_info *vi)
{ … }
static int ubiblock_resize(struct ubi_volume_info *vi)
{ … }
static bool
match_volume_desc(struct ubi_volume_info *vi, const char *name, int ubi_num, int vol_id)
{ … }
static void
ubiblock_create_from_param(struct ubi_volume_info *vi)
{ … }
static int ubiblock_notify(struct notifier_block *nb,
unsigned long notification_type, void *ns_ptr)
{ … }
static struct notifier_block ubiblock_notifier = …;
static void ubiblock_remove_all(void)
{ … }
int __init ubiblock_init(void)
{ … }
void ubiblock_exit(void)
{ … }