From: Liam R. Howlett Date: Fri, 28 Aug 2020 18:30:51 +0000 (-0400) Subject: maple_tree: Rename flags defines X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=af6a966e5b567a762ffccc4b0f88fb4496226c0e;p=users%2Fjedix%2Flinux-maple.git maple_tree: Rename flags defines Signed-off-by: Liam R. Howlett --- diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index b38b39f6b67bd..acb218c138710 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -182,12 +182,14 @@ enum maple_type { /* Flags: * MAPLE_ALLOC_RANGE Use allocation ranges (tracks gaps) in this tree - * MAPLE_RCU Operate in read/copy/update mode for multi-readers. + * MAPLE_USE_RCU Operate in read/copy/update mode for multi-readers. + * MAPLE_HEIGHT_OFFSET The position of the tree height in the flags + * MAPLE_HEIGHT_MASK The mask for the maple tree height value. */ #define MAPLE_ALLOC_RANGE 1 // Bit 0 -#define MAPLE_RCU 2 // Bit 1 +#define MAPLE_USE_RCU 2 // Bit 1 #define MAPLE_HEIGHT_OFFSET 2 // Bits 2-4 -#define MAPLE_HEIGHT 28 // Bits 2-4 +#define MAPLE_HEIGHT_MASK 28 // Bits 2-4 struct maple_tree { spinlock_t ma_lock; unsigned int ma_flags; diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 3f216d21dd878..d4ffcd4b15501 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -144,13 +144,13 @@ static void ma_free_rcu(struct maple_node *node) static unsigned int mt_height(const struct maple_tree *mt) { - return (mt->ma_flags & MAPLE_HEIGHT) >> MAPLE_HEIGHT_OFFSET; + return (mt->ma_flags & MAPLE_HEIGHT_MASK) >> MAPLE_HEIGHT_OFFSET; } static void mas_set_height(struct ma_state *mas) { unsigned int new_flags = mas->tree->ma_flags; - new_flags &= ~MAPLE_HEIGHT; + new_flags &= ~MAPLE_HEIGHT_MASK; new_flags |= mas->depth << MAPLE_HEIGHT_OFFSET; mas->tree->ma_flags = new_flags; }