Commit 0edd7b5
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>1 parent 62047e0 commit 0edd7b5
1 file changed
Lines changed: 40 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
| 626 | + | |
633 | 627 | | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
| 628 | + | |
639 | 629 | | |
640 | 630 | | |
641 | 631 | | |
642 | 632 | | |
643 | 633 | | |
644 | | - | |
| 634 | + | |
645 | 635 | | |
646 | 636 | | |
647 | 637 | | |
648 | 638 | | |
649 | 639 | | |
650 | 640 | | |
651 | 641 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | 642 | | |
656 | | - | |
657 | 643 | | |
658 | | - | |
659 | 644 | | |
660 | 645 | | |
661 | 646 | | |
| |||
680 | 665 | | |
681 | 666 | | |
682 | 667 | | |
683 | | - | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
| |||
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
714 | | - | |
| 715 | + | |
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
721 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
722 | 741 | | |
723 | 742 | | |
724 | 743 | | |
| |||
0 commit comments