Cc: Christian Hesse <mail@...>, <linux-kernel@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, Con Kolivas <kernel@...>, Nick Piggin <npiggin@...>, Mike Galbraith <efault@...>, Arjan van de Ven <arjan@...>, Thomas Gleixner <tglx@...>, <suspend2-devel@...>
I don't think it safe to change the key after inserting the element in the
tree. You end up with an unsorted tree giving where new entries end up in
wrong places "randomly".
I think a better approach would be to keep track of the rightmost entry,
set the key to the rightmost's key +1 and then simply insert it there.
Esben
-