augmented rbtree: rework the RB_DECLARE_CALLBACKS macro definition
Change the definition of the RBCOMPUTE function. The propagate callback
repeatedly calls RBCOMPUTE as it moves from leaf to root. it wants to
stop recomputing once the augmented subtree information doesn't change.
This was previously checked using the == operator, but that only works
when the augmented subtree information is a scalar field. This commit
modifies the RBCOMPUTE function so that it now sets the augmented subtree
information instead of returning it, and returns a boolean value
indicating if the propagate callback should stop.
The motivation for this change is that I want to introduce augmented
rbtree uses where the augmented data for the subtree is a struct instead
of a scalar.
Signed-off-by: Michel Lespinasse <email@example.com>
Acked-by: Peter Zijlstra (Intel) <firstname.lastname@example.org>
Cc: David Howells <email@example.com>
Cc: Davidlohr Bueso <firstname.lastname@example.org>
Cc: Uladzislau Rezki <email@example.com>
Signed-off-by: Andrew Morton <firstname.lastname@example.org>
2 files changed