mm: vmalloc: introduce array allocation functions
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 09:47:22 +0000 (04:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:35:01 +0000 (16:35 +0200)
commitc33904fd1ef49095488060f8e3ac807c6d70ca04
treeb90a82ccdfc8f44aaec6039b9d981cda4b986290
parentff41804632e530e8f8971f45b23ca29d63edf243
mm: vmalloc: introduce array allocation functions

[ Upstream commit a8749a35c39903120ec421ef2525acc8e0daa55c ]

Linux has dozens of occurrences of vmalloc(array_size()) and
vzalloc(array_size()).  Allow to simplify the code by providing
vmalloc_array and vcalloc, as well as the underscored variants that let
the caller specify the GFP flags.

Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/vmalloc.h
mm/util.c