// SPDX-License-Identifier: GPL-2.0-only#include<linux/mm.h>#include<linux/slab.h>#include<linux/string.h>#include<linux/compiler.h>#include<linux/export.h>#include<linux/err.h>#include<linux/sched.h>#include<linux/sched/mm.h>#include<linux/sched/signal.h>#include<linux/sched/task_stack.h>#include<linux/security.h>#include<linux/swap.h>#include<linux/swapops.h>#include<linux/sysctl.h>#include<linux/mman.h>#include<linux/hugetlb.h>#include<linux/vmalloc.h>#include<linux/userfaultfd_k.h>#include<linux/elf.h>#include<linux/elf-randomize.h>#include<linux/personality.h>#include<linux/random.h>#include<linux/processor.h>#include<linux/sizes.h>#include<linux/compat.h>#include<linux/fsnotify.h>#include<linux/page_idle.h>#include<linux/uaccess.h>#include<kunit/visibility.h>#include"internal.h"#include"swap.h"/** * kfree_const - conditionally free memory * @x: pointer to the memory * * Function calls kfree only if @x is not in .rodata section. */voidkfree_const(constvoid*x){if(!is_kernel_rodata((unsignedlong)x))kfree(x);}EXPORT_SYMBOL(kfree_const);/** * __kmemdup_nul - Create a NUL-terminated string from @s, which might be unterminated. * @s: The data to copy * @len: The size of the data, not including the NUL terminator * @gfp: the GFP mask used in the kmalloc() call when allocating memory * * Return: newly allocated copy of @s with NUL-termination or %NULL in * case of error */static__always_inlinechar