drivers/block/zram/Kconfig

Source file repositories/reference/linux-study-clean/drivers/block/zram/Kconfig

File Facts

System
Linux kernel
Corpus path
drivers/block/zram/Kconfig
Extension
[no extension]
Size
3938 bytes
Lines
148
Domain
Driver Families
Bucket
drivers/block
Inferred role
Driver Families: build/configuration rule
Status
atlas-only

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0
config ZRAM
	tristate "Compressed RAM block device support"
	depends on BLOCK && SYSFS && MMU
	select ZSMALLOC
	help
	  Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
	  Pages written to these disks are compressed and stored in memory
	  itself. These disks allow very fast I/O and compression provides
	  good amounts of memory savings.

	  It has several use cases, for example: /tmp storage, use as swap
	  disks and maybe many more.

	  See Documentation/admin-guide/blockdev/zram.rst for more information.

config ZRAM_BACKEND_LZ4
	bool "lz4 compression support"
	depends on ZRAM
	select LZ4_COMPRESS
	select LZ4_DECOMPRESS

config ZRAM_BACKEND_LZ4HC
	bool "lz4hc compression support"
	depends on ZRAM
	select LZ4HC_COMPRESS
	select LZ4_DECOMPRESS

config ZRAM_BACKEND_ZSTD
	bool "zstd compression support"
	depends on ZRAM
	select ZSTD_COMPRESS
	select ZSTD_DECOMPRESS

config ZRAM_BACKEND_DEFLATE
	bool "deflate compression support"
	depends on ZRAM
	select ZLIB_DEFLATE
	select ZLIB_INFLATE

config ZRAM_BACKEND_842
	bool "842 compression support"
	depends on ZRAM
	select 842_COMPRESS
	select 842_DECOMPRESS

config ZRAM_BACKEND_FORCE_LZO
	depends on ZRAM
	def_bool !ZRAM_BACKEND_LZ4 && !ZRAM_BACKEND_LZ4HC && \
		!ZRAM_BACKEND_ZSTD && !ZRAM_BACKEND_DEFLATE && \
		!ZRAM_BACKEND_842

config ZRAM_BACKEND_LZO
	bool "lzo and lzo-rle compression support" if !ZRAM_BACKEND_FORCE_LZO
	depends on ZRAM
	default ZRAM_BACKEND_FORCE_LZO
	select LZO_COMPRESS
	select LZO_DECOMPRESS

choice
	prompt "Default zram compressor"
	default ZRAM_DEF_COMP_LZORLE
	depends on ZRAM

config ZRAM_DEF_COMP_LZORLE
	bool "lzo-rle"
	depends on ZRAM_BACKEND_LZO

config ZRAM_DEF_COMP_LZO
	bool "lzo"

Annotation

Implementation Notes