lkml.org 
[lkml]   [2004]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] Generalized prio_tree, revisited
Werner Almesberger wrote:
> did you have a chance to look at the prio_tree generalization ?
>
> I've attached the patch I posted a month ago (plus the trivial
> "const" change). It's for 2.6.9, but also applies to 2.6.10-rc2,
> which I've been using for a good while now.
>
> The patch splits the radix priority search trees into two types:
> the "raw" one with implicit keys, as it's currently used, and a
> new, generalized one with explicit keys, which should be used by
> new code.

> struct prio_tree_root {
> struct prio_tree_node *prio_tree_node;
> - unsigned int index_bits;
> + unsigned short index_bits;
> + unsigned short raw;
> + /*
> + * 0: nodes are of type struct prio_tree_node
> + * 1: nodes are of type raw_prio_tree_node
> + */
> };

> - INIT_PRIO_TREE_ROOT(&inode->i_data.i_mmap);
> + INIT_PRIO_TREE_ROOT(&inode->i_data.i_mmap, 1);

While not being able to comment on the actual patch I think having a 1
or 0 for different types is not clear. Naming them different struct
names would seem to me much more readable.

Cheers,
Con
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.102 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site