Re: [PATCH][v2] Modify loop device to be able to manage partitionsof the disk image

From: Randy Dunlap
Date: Fri Mar 07 2008 - 11:41:42 EST


On Fri, 7 Mar 2008 13:27:40 +0100 Laurent Vivier wrote:

> This patch allows to use loop device with partitionned disk image.
>
> Original behavior of loop is not modified.
>
> A new parameter is introduced to define how many partition we want to be
> able to manage per loop device. This parameter is "loop_max_part".
>
> __setup("max_loop=", max_loop_setup);
> +
> +static int __init max_part_setup(char *str)
> +{
> + loop_max_part = simple_strtol(str, NULL, 0);
> + if (loop_max_part > (1UL << (MINORBITS - 1))) {
> + /* we must keep at least one bit for loop device number */
> + printk(KERN_ERR
> + "loop: loop_max_part cannot be greater than %d\n",

That %d should be %lu, otherwise gcc says:

drivers/block/loop.c:1594: warning: format '%d' expects type 'int', but ar
gument 2 has type 'long unsigned int

> + 1UL << (MINORBITS - 1));
> + return 0;
> + }
> + return 1;
> +}
> +
> +__setup("loop_max_part=", max_part_setup);
> #endif

---
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/