Messages in this thread | | | Date | Fri, 7 Mar 2008 08:34:52 -0800 | From | Randy Dunlap <> | Subject | Re: [PATCH][v2] Modify loop device to be able to manage partitions of the disk image |
| |
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
| |