* [PATCH 2.6.27-rc2] block: loop device partition support
@ 2008-08-09 0:54 Christian Franke
2008-08-09 3:43 ` H. Peter Anvin
0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2008-08-09 0:54 UTC (permalink / raw)
To: linux-kernel
From: Christian Franke <cfchris6@yahoo.de>
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.
Signed-off-by: Christian Franke <cfchris6@yahoo.de>
---
--- linux-2.6/drivers/block/Kconfig
+++ linux-2.6-loop/drivers/block/Kconfig
@@ -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
--- linux-2.6/drivers/block/loop.c
+++ linux-2.6-loop/drivers/block/loop.c
@@ -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;
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.27-rc2] block: loop device partition support
2008-08-09 0:54 [PATCH 2.6.27-rc2] block: loop device partition support Christian Franke
@ 2008-08-09 3:43 ` H. Peter Anvin
0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2008-08-09 3:43 UTC (permalink / raw)
To: Christian Franke; +Cc: linux-kernel
Christian Franke wrote:
> From: Christian Franke <cfchris6@yahoo.de>
>
> 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.
The right thing would be to have a backwards compatiblity major and a
new major; similar to how the md device handles it.
-hpa
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-09 3:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-09 0:54 [PATCH 2.6.27-rc2] block: loop device partition support Christian Franke
2008-08-09 3:43 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox