lkml.org 
[lkml]   [2007]   [Mar]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromKyle Moffett <>
SubjectRe: [PATCH] max_loop limit
DateWed, 28 Mar 2007 23:54:17 -0400
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

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

\
 
 \ /
  Last update: 2007-03-29 06:05    [from the cache]
©2003-2008