#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/blktrans.h>
#include <linux/rbtree.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/genhd.h>
#include <linux/swap.h>
#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/device.h>
#include <linux/math64.h>
Go to the source code of this file.
|
enum | {
MTDSWAP_CLEAN,
MTDSWAP_USED,
MTDSWAP_LOWFRAG,
MTDSWAP_HIFRAG,
MTDSWAP_DIRTY,
MTDSWAP_BITFLIP,
MTDSWAP_FAILING,
MTDSWAP_TREE_CNT
} |
|
enum | { MTDSWAP_SCANNED_CLEAN,
MTDSWAP_SCANNED_DIRTY,
MTDSWAP_SCANNED_BITFLIP,
MTDSWAP_SCANNED_BAD
} |
|
|
struct mtdswap_oobdata | __attribute__ ((packed)) |
|
| module_param_string (partitions, partitions, sizeof(partitions), 0444) |
|
| MODULE_PARM_DESC (partitions,"MTD partition numbers to use as swap ""partitions=\"1,3,5\"") |
|
| module_param (spare_eblocks, uint, 0444) |
|
| MODULE_PARM_DESC (spare_eblocks,"Percentage of spare erase blocks for ""garbage collection (default 10%)") |
|
| module_param (header, bool, 0444) |
|
| MODULE_PARM_DESC (header,"Include builtin swap header (default 0, without header)") |
|
| module_init (mtdswap_modinit) |
|
| module_exit (mtdswap_modexit) |
|
| MODULE_LICENSE ("GPL") |
|
| MODULE_AUTHOR ("Jarkko Lavinen <[email protected]>") |
|
| MODULE_DESCRIPTION ("Block device access to an MTD suitable for using as ""swap space") |
|
#define CLEAN_BLOCK_THRESHOLD 20 |
#define COLLECT_NONDIRTY_FREQ1 6 |
#define COLLECT_NONDIRTY_FREQ2 4 |
#define EBLOCK_BAD (1 << 0) |
#define EBLOCK_BITFLIP (1 << 2) |
#define EBLOCK_FAILED (1 << 3) |
#define EBLOCK_IDX_SHIFT 5 |
#define EBLOCK_NOMAGIC (1 << 1) |
#define EBLOCK_READERR (1 << 4) |
#define LOW_FRAG_GC_TRESHOLD 5 |
#define MAX_ERASE_DIFF 4000 |
#define MIN_SPARE_EBLOCKS 2 |
#define MTDSWAP_ECNT_MAX |
( |
|
rbroot | ) |
|
#define MTDSWAP_ECNT_MIN |
( |
|
rbroot | ) |
|
#define MTDSWAP_ERASE_RETRIES 3 /* Before marking erase block bad */ |
#define MTDSWAP_IO_RETRIES 3 |
#define MTDSWAP_MAGIC_CLEAN 0x2095 |
#define MTDSWAP_PREFIX "mtdswap" |
#define MTDSWAP_TYPE_CLEAN 0 |
#define MTDSWAP_TYPE_DIRTY 1 |
- Enumerator:
MTDSWAP_CLEAN |
|
MTDSWAP_USED |
|
MTDSWAP_LOWFRAG |
|
MTDSWAP_HIFRAG |
|
MTDSWAP_DIRTY |
|
MTDSWAP_BITFLIP |
|
MTDSWAP_FAILING |
|
MTDSWAP_TREE_CNT |
|
Definition at line 102 of file mtdswap.c.
- Enumerator:
MTDSWAP_SCANNED_CLEAN |
|
MTDSWAP_SCANNED_DIRTY |
|
MTDSWAP_SCANNED_BITFLIP |
|
MTDSWAP_SCANNED_BAD |
|
Definition at line 159 of file mtdswap.c.
module_exit |
( |
mtdswap_modexit |
| ) |
|
module_init |
( |
mtdswap_modinit |
| ) |
|
module_param |
( |
spare_eblocks |
, |
|
|
uint |
, |
|
|
0444 |
|
|
) |
| |
module_param_string |
( |
partitions |
, |
|
|
partitions |
, |
|
|
sizeof(partitions) |
, |
|
|
0444 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
partitions |
, |
|
|
"MTD partition numbers to use as swap "" |
partitions = \"1,3,5\"" |
|
) |
| |
MODULE_PARM_DESC |
( |
spare_eblocks |
, |
|
|
"Percentage of spare erase blocks for ""garbage collection (default 10%)" |
|
|
) |
| |