]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: preallocate nodes in mas_erase()
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Wed, 14 Aug 2024 16:19:33 +0000 (12:19 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:53:18 +0000 (17:53 -0700)
commit2f7d447351132b764e19b3ffeb15f1a48d874f18
tree500d166fb0bb61fcc80f97e8259e4d1c3ce81bf2
parent81ea04e3c6e7e9cee9aa93cd4ddd1182f774ed05
maple_tree: preallocate nodes in mas_erase()

Use mas_wr_preallocate() in mas_erase() to preallocate enough nodes to
complete the erase.  Add error handling by skipping the store if the
preallocation lead to some error besides no memory.

Link: https://lkml.kernel.org/r/20240814161944.55347-7-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c