Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3215902 authored by Jarkko Lavinen's avatar Jarkko Lavinen Committed by David Woodhouse
Browse files

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: default avatarJarkko Lavinen <jarkko.lavinen@nokia.com>
Tested-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 115ee88c
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -325,6 +325,24 @@ config MTD_OOPS
	  To use, add console=ttyMTDx to the kernel command line,
	  where x is the MTD device number to use.

config MTD_SWAP
	tristate "Swap on MTD device support"
	depends on MTD && SWAP
	select MTD_BLKDEVS
	help
	  Provides volatile block device driver on top of mtd partition
          suitable for swapping.  The mapping of written blocks is not saved.
	  The driver provides wear leveling by storing erase counter into the
	  OOB.

config MTD_SWAP_STRICT
       bool "Strict erase error handling"
       depends on MTD_SWAP
       help
	 Enables strict tolerance on failed erasures, marking erase blocks bad
	 right after the first failed operation. With non-strict mode the
	 erase operation is retried.

source "drivers/mtd/chips/Kconfig"

source "drivers/mtd/maps/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ obj-$(CONFIG_RFD_FTL) += rfd_ftl.o
obj-$(CONFIG_SSFDC)		+= ssfdc.o
obj-$(CONFIG_SM_FTL)		+= sm_ftl.o
obj-$(CONFIG_MTD_OOPS)		+= mtdoops.o
obj-$(CONFIG_MTD_SWAP)		+= mtdswap.o

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

drivers/mtd/mtdswap.c

0 → 100644
+1593 −0

File added.

Preview size limit exceeded, changes collapsed.