lkml.org 
[lkml]   [2008]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.6.27-rc2] block: loop device partition support
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;

/*


\
 
 \ /
  Last update: 2008-08-09 02:57    [W:0.035 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site