block: loop device partition support
PATCH 1/1 block: loop device partition support
From: Christian Franke <[email protected]>
By default, partition support of loop devices is disabled and there seems to be no way to turn it on without changing code, if loop is not compiled as module. This patch introduces CONFIG_BLK_DEV_LOOP_MAXPART to make partition support configurable via Kconfig. It keeps that feature disabled by default for not breaking backward compatibility.
---
drivers/block/Kconfig +17 -0
@@ -248,6 +248,23 @@ config BLK_DEV_LOOP Most users will answer N here. +config BLK_DEV_LOOP_MAXPART + int "Maximum number of partitions per loop device" + default "0" + depends on BLK_DEV_LOOP + ---help--- + Loop device partition support is disabled by default. If max_part + is non-zero, partition support for loop devices is enabled for up to + max_part partitions. + + Note: If you compile loop as module, you can also pass max_part as + parameter when loading it. + + Warning: non-zero values break compatibility with applications which + access the loop devices via major and minor number. + + Most users will answer 0 here. + config BLK_DEV_CRYPTOLOOP tristate "Cryptoloop Support" select CRYPTO
drivers/block/loop.c +1 -1
@@ -82,7 +82,7 @@static LIST_HEAD (loop_devices);static DEFINE_MUTEX (loop_devices_mutex); -static int max_part; +static int max_part =CONFIG_BLK_DEV_LOOP_MAXPART ;static int part_shift;/*
Quoted 4 lines · Christian Franke
From: Christian Franke <[email protected]>
By default, partition support of loop devices is disabled and there seems to be no way to turn it on without changing code, if loop is not compiled as module. This patch introduces
CONFIG_BLK_DEV_LOOP_MAXPARTto make partition support configurable viaKconfig. It keeps that feature disabled by default for not breaking backward compatibility.
The right thing would be to have a backwards compatiblity major and a new major; similar to how the md device handles it.
-hpa