augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro

Add RB_DECLARE_CALLBACKS_MAX, which generates augmented rbtree callbacks
for the case where the augmented value is a scalar whose definition
follows a max(f(node)) pattern.  This actually covers all present uses of
RB_DECLARE_CALLBACKS, and saves some (source) code duplication in the
various RBCOMPUTE function definitions.

Signed-off-by: Michel Lespinasse <>
Acked-by: Peter Zijlstra (Intel) <>
Cc: David Howells <>
Cc: Davidlohr Bueso <>
Cc: Uladzislau Rezki <>
Signed-off-by: Andrew Morton <>
7 files changed