#include <linux/hdreg.h>
#include <linux/init.h>
#include <linux/mtd/blktrans.h>
#include <linux/mtd/mtd.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <asm/types.h>
static int block_size = …;
module_param(block_size, int, 0);
MODULE_PARM_DESC(…) …;
#define PREFIX …
#ifndef RFD_FTL_MAJOR
#define RFD_FTL_MAJOR …
#endif
#define PART_BITS …
#define RFD_MAGIC …
#define HEADER_MAP_OFFSET …
#define SECTOR_DELETED …
#define SECTOR_ZERO …
#define SECTOR_FREE …
#define SECTOR_SIZE …
#define SECTORS_PER_TRACK …
struct block { … };
struct partition { … };
static int rfd_ftl_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf);
static int build_block_map(struct partition *part, int block_no)
{ … }
static int scan_header(struct partition *part)
{ … }
static int rfd_ftl_readsect(struct mtd_blktrans_dev *dev, u_long sector, char *buf)
{ … }
static int erase_block(struct partition *part, int block)
{ … }
static int move_block_contents(struct partition *part, int block_no, u_long *old_sector)
{ … }
static int reclaim_block(struct partition *part, u_long *old_sector)
{ … }
static int find_free_block(struct partition *part)
{ … }
static int find_writable_block(struct partition *part, u_long *old_sector)
{ … }
static int mark_sector_deleted(struct partition *part, u_long old_addr)
{ … }
static int find_free_sector(const struct partition *part, const struct block *block)
{ … }
static int do_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf, ulong *old_addr)
{ … }
static int rfd_ftl_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *buf)
{ … }
static int rfd_ftl_discardsect(struct mtd_blktrans_dev *dev,
unsigned long sector, unsigned int nr_sects)
{ … }
static int rfd_ftl_getgeo(struct mtd_blktrans_dev *dev, struct hd_geometry *geo)
{ … }
static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
{ … }
static void rfd_ftl_remove_dev(struct mtd_blktrans_dev *dev)
{ … }
static struct mtd_blktrans_ops rfd_ftl_tr = …;
module_mtd_blktrans(…);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;