From: Rajesh Venkatasubramanian <vrajesh@umich.edu>
To: Werner Almesberger <werner@almesberger.net>
Cc: linux-kernel@vger.kernel.org, kernel@kolivas.org
Subject: Re: [RFC] Generalized prio_tree, revisited
Date: Thu, 16 Dec 2004 15:01:05 -0500 [thread overview]
Message-ID: <41C1E981.1030800@umich.edu> (raw)
In-Reply-To: <20041216163816.X1229@almesberger.net>
Werner Almesberger wrote:
> You mean to roll prio_tree_first and prio_tree_iter_init into a
> single call, so that prio_tree_first would look similar to the
> one in 2.6.7 ?
Something like this...
---
linux-2.6.9-testuser/include/linux/prio_tree.h | 1 +
linux-2.6.9-testuser/mm/prio_tree.c | 3 +++
2 files changed, 4 insertions(+)
diff -puN include/linux/prio_tree.h~roll_prio_tree_first include/linux/prio_tree.h
--- linux-2.6.9/include/linux/prio_tree.h~roll_prio_tree_first 2004-12-16 14:52:46.878268680 -0500
+++ linux-2.6.9-testuser/include/linux/prio_tree.h 2004-12-16 14:55:18.731183528 -0500
@@ -29,6 +29,7 @@ static inline void prio_tree_iter_init(s
iter->root = root;
iter->r_index = r_index;
iter->h_index = h_index;
+ iter->cur = NULL;
}
#define INIT_PRIO_TREE_ROOT(ptr) \
diff -puN mm/prio_tree.c~roll_prio_tree_first mm/prio_tree.c
--- linux-2.6.9/mm/prio_tree.c~roll_prio_tree_first 2004-12-16 14:55:27.695820696 -0500
+++ linux-2.6.9-testuser/mm/prio_tree.c 2004-12-16 14:56:31.889061840 -0500
@@ -457,6 +457,9 @@ static struct prio_tree_node *prio_tree_
{
unsigned long r_index, h_index;
+ if (iter->cur == NULL)
+ return prio_tree_first(iter);
+
repeat:
while (prio_tree_left(iter, &r_index, &h_index))
if (overlap(iter, r_index, h_index))
_
next prev parent reply other threads:[~2004-12-16 20:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-16 8:31 [RFC] Generalized prio_tree, revisited Werner Almesberger
2004-12-16 9:02 ` Con Kolivas
2004-12-16 9:15 ` Werner Almesberger
2004-12-16 9:33 ` Con Kolivas
2004-12-16 13:23 ` Werner Almesberger
2004-12-16 11:12 ` Rajesh Venkatasubramanian
2004-12-16 13:57 ` Werner Almesberger
2004-12-16 15:04 ` Rajesh Venkatasubramanian
2004-12-16 19:38 ` Werner Almesberger
2004-12-16 20:01 ` Rajesh Venkatasubramanian [this message]
2004-12-17 4:44 ` Werner Almesberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41C1E981.1030800@umich.edu \
--to=vrajesh@umich.edu \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
--cc=werner@almesberger.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox