diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2015-06-26 00:00:11 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-26 02:00:36 +0200 |
commit | c3cdb40e66344553898daa3ccd068c03173a3f42 (patch) | |
tree | 53fd5157d5958c12a36969b73c298c6ebbeabdd6 | |
parent | zram: reorganize code layout (diff) | |
download | linux-c3cdb40e66344553898daa3ccd068c03173a3f42.tar.xz linux-c3cdb40e66344553898daa3ccd068c03173a3f42.zip |
zram: remove max_num_devices limitation
Limiting the number of zram devices to 32 (default max_num_devices value)
is confusing, let's drop it. A user with 2TB or 4TB of RAM, for example,
can request as many devices as he can handle.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | Documentation/blockdev/zram.txt | 4 | ||||
-rw-r--r-- | drivers/block/zram/zram_drv.c | 8 | ||||
-rw-r--r-- | drivers/block/zram/zram_drv.h | 6 |
3 files changed, 4 insertions, 14 deletions
diff --git a/Documentation/blockdev/zram.txt b/Documentation/blockdev/zram.txt index bef499868269..65e94301e57b 100644 --- a/Documentation/blockdev/zram.txt +++ b/Documentation/blockdev/zram.txt @@ -19,7 +19,9 @@ Following shows a typical sequence of steps for using zram. 1) Load Module: modprobe zram num_devices=4 This creates 4 devices: /dev/zram{0,1,2,3} - (num_devices parameter is optional. Default: 1) + +num_devices parameter is optional and tells zram how many devices should be +pre-created. Default: 1. 2) Set max number of compression streams Compression backend may use up to max_comp_streams compression streams, diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 82bc2ff9bd81..70aac2e564e9 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1287,12 +1287,6 @@ static int __init zram_init(void) { int ret, dev_id; - if (num_devices > max_num_devices) { - pr_warn("Invalid value for num_devices: %u\n", - num_devices); - return -EINVAL; - } - zram_major = register_blkdev(0, "zram"); if (zram_major <= 0) { pr_warn("Unable to get major number\n"); @@ -1322,7 +1316,7 @@ module_init(zram_init); module_exit(zram_exit); module_param(num_devices, uint, 0); -MODULE_PARM_DESC(num_devices, "Number of zram devices"); +MODULE_PARM_DESC(num_devices, "Number of pre-created zram devices"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Nitin Gupta <ngupta@vflare.org>"); diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h index 570c598f4ce9..042994e807cf 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h @@ -20,12 +20,6 @@ #include "zcomp.h" -/* - * Some arbitrary value. This is just to catch - * invalid value for num_devices module parameter. - */ -static const unsigned max_num_devices = 32; - /*-- Configurable parameters */ /* |