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 <>
Acked-by: Peter Zijlstra (Intel) <>
Cc: David Howells <>
Cc: Davidlohr Bueso <>
Cc: Uladzislau Rezki <>
Signed-off-by: Andrew Morton <>
2 files changed