From: Liam R. Howlett Date: Wed, 30 Oct 2019 18:27:07 +0000 (-0400) Subject: maple_tree: Convert old ms arguemnt to mas. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0ea168fad743fdace3df6de6c30533c37c98c949;p=users%2Fjedix%2Flinux-maple.git maple_tree: Convert old ms arguemnt to mas. Change the name of the maple state variable to mas. Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 8df4eae5e6868..af014df6908f5 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -918,41 +918,41 @@ static inline void ma_free_alloc(struct maple_node *node) * Check if there was an error allocating and do the allocation if necessary * If there are allocations, then free them. */ -bool mas_nomem(struct ma_state *ms, gfp_t gfp) - __must_hold(ms->tree->lock) +bool mas_nomem(struct ma_state *mas, gfp_t gfp) + __must_hold(mas->tree->lock) { - if (ms->node != MA_ERROR(-ENOMEM)) { - struct maple_node *node = mas_get_alloc(ms); + if (mas->node != MA_ERROR(-ENOMEM)) { + struct maple_node *node = mas_get_alloc(mas); if (node) ma_free_alloc(node); - ms->alloc = NULL; + mas->alloc = NULL; return false; } if (gfpflags_allow_blocking(gfp)) { - mtree_unlock(ms->tree); - mas_node_node(ms, gfp); - mtree_lock(ms->tree); + mtree_unlock(mas->tree); + mas_node_node(mas, gfp); + mtree_lock(mas->tree); } else { - mas_node_node(ms, gfp); + mas_node_node(mas, gfp); } - if (!mas_get_alloc(ms)) + if (!mas_get_alloc(mas)) return false; - ms->node = MAS_START; + mas->node = MAS_START; return true; } -static inline struct maple_node *mas_node_cnt(struct ma_state *ms, int count) +static inline struct maple_node *mas_node_cnt(struct ma_state *mas, int count) { - int allocated = mas_get_alloc_cnt(ms); + int allocated = mas_get_alloc_cnt(mas); BUG_ON(count > 127); if (allocated < count) { - mas_set_alloc_req(ms, count - allocated); - mas_node_node(ms, GFP_NOWAIT | __GFP_NOWARN); + mas_set_alloc_req(mas, count - allocated); + mas_node_node(mas, GFP_NOWAIT | __GFP_NOWARN); } - return ms->alloc; + return mas->alloc; } /** Private