mm: kmemleak: split __create_object into two functions
authorLiu Shixin <liushixin2@huawei.com>
Wed, 18 Oct 2023 10:29:49 +0000 (18:29 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 25 Oct 2023 23:47:13 +0000 (16:47 -0700)
commit0edd7b58293340d26380d7510fd4fc08e5902511
treeae784dd31ccee2c6fa352860703812c22bc674e1
parent62047e0f3e3a707599afe6d43cf684a2a02d05d5
mm: kmemleak: split __create_object into two functions

__create_object() consists of two part, the first part allocate a kmemleak
object and initialize it, the second part insert it into object tree.
This function need kmemleak_lock but actually only the second part need
lock.

Split it into two functions, the first function __alloc_object only
allocate a kmemleak object, and the second function __link_object() will
initialize the object and insert it into object tree, use the
kmemleak_lock to protect __link_object() only.

[akpm@linux-foundation.org: coding-style cleanups]
Link: https://lkml.kernel.org/r/20231018102952.3339837-5-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Patrick Wang <patrick.wang.shcn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kmemleak.c