Skip to content

Commit a321590

Browse files
Jarkko LavinenDavid Woodhouse
authored andcommitted
mtd: Add mtdswap block driver
Add a driver for allowing an mtd device to be used as a block device for swapping. The block device is volatile, and the mapping of swapped pages is not stored on flash. Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 115ee88 commit a321590

3 files changed

Lines changed: 1612 additions & 0 deletions

File tree

‎drivers/mtd/Kconfig‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,24 @@ config MTD_OOPS
325325
To use, add console=ttyMTDx to the kernel command line,
326326
where x is the MTD device number to use.
327327

328+
config MTD_SWAP
329+
tristate "Swap on MTD device support"
330+
depends on MTD && SWAP
331+
select MTD_BLKDEVS
332+
help
333+
Provides volatile block device driver on top of mtd partition
334+
suitable for swapping. The mapping of written blocks is not saved.
335+
The driver provides wear leveling by storing erase counter into the
336+
OOB.
337+
338+
config MTD_SWAP_STRICT
339+
bool "Strict erase error handling"
340+
depends on MTD_SWAP
341+
help
342+
Enables strict tolerance on failed erasures, marking erase blocks bad
343+
right after the first failed operation. With non-strict mode the
344+
erase operation is retried.
345+
328346
source "drivers/mtd/chips/Kconfig"
329347

330348
source "drivers/mtd/maps/Kconfig"

‎drivers/mtd/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ obj-$(CONFIG_RFD_FTL) += rfd_ftl.o
2525
obj-$(CONFIG_SSFDC) += ssfdc.o
2626
obj-$(CONFIG_SM_FTL) += sm_ftl.o
2727
obj-$(CONFIG_MTD_OOPS) += mtdoops.o
28+
obj-$(CONFIG_MTD_SWAP) += mtdswap.o
2829

2930
nftl-objs := nftlcore.o nftlmount.o
3031
inftl-objs := inftlcore.o inftlmount.o

0 commit comments

Comments
 (0)