Re: [PATCH] max_loop limit

Kyle Moffett
2007-03-29T04:02:58Z

On Mar 23, 2007, at 19:26:34, Jan Engelhardt wrote:
> here's one. Allocates all the fluff dynamically. It does not create
> any dev nodes by itself, so you need to do it (à la mdadm), but
> you'll get all 1048576 available minors.
>
> +static LIST_HEAD(loop_devices);

Maybe an rbtree would work better here? Maximum number of nodes
traversed to get to the bottom of the tree given 2^(20) loop devices
is 19 as opposed to the 2^(20) for a linked list. Also, to preserve
compatibility with existing userspace loop tools you should probably
always allocate one extra loop device. Keep a "highest used loopdev"
number and create the one after that so that udev will autocreate a
dev node for it.

Cheers,
Kyle Moffett