linux/drivers/mtd/mtdblock.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Direct MTD block device access
 *
 * Copyright © 1999-2010 David Woodhouse <[email protected]>
 * Copyright © 2000-2003 Nicolas Pitre <[email protected]>
 */

#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/vmalloc.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/blktrans.h>
#include <linux/mutex.h>
#include <linux/major.h>


struct mtdblk_dev {};

/*
 * Cache stuff...
 *
 * Since typical flash erasable sectors are much larger than what Linux's
 * buffer cache can handle, we must implement read-modify-write on flash
 * sectors for each block write requests.  To avoid over-erasing flash sectors
 * and to speed things up, we locally cache a whole flash sector while it is
 * being written to until a different sector is required.
 */

static int erase_write (struct mtd_info *mtd, unsigned long pos,
			unsigned int len, const char *buf)
{}


static int write_cached_data (struct mtdblk_dev *mtdblk)
{}


static int do_cached_write (struct mtdblk_dev *mtdblk, unsigned long pos,
			    int len, const char *buf)
{}


static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos,
			   int len, char *buf)
{}

static int mtdblock_readsect(struct mtd_blktrans_dev *dev,
			      unsigned long block, char *buf)
{}

static int mtdblock_writesect(struct mtd_blktrans_dev *dev,
			      unsigned long block, char *buf)
{}

static int mtdblock_open(struct mtd_blktrans_dev *mbd)
{}

static void mtdblock_release(struct mtd_blktrans_dev *mbd)
{}

static int mtdblock_flush(struct mtd_blktrans_dev *dev)
{}

static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
{}

static void mtdblock_remove_dev(struct mtd_blktrans_dev *dev)
{}

static struct mtd_blktrans_ops mtdblock_tr =;

module_mtd_blktrans();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();