mm: add some missing includes to mm-local headers

There are a number of internal headers local to mm/ which reference
functions and data types without including the relevant headers.

mm/vma.h is a special case that intentionally does not include additional
headers, but the others are not.

This breaks tooling like clangd (which is where I noticed this), though
the build is OK due to the C files including the headers happening to
include required dependencies.

It's better to be explicit about dependencies anyway, so add the missing
includes and fix clangd as a bonus.

Link: https://lore.kernel.org/[email protected]
Signed-off-by: Lorenzo Stoakes (ARM) <[email protected]>
Acked-by: Vlastimil Babka (SUSE) <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Acked-by: Zi Yan <[email protected]>
Reviewed-by: Barry Song <[email protected]>
Reviewed-by: Baoquan He <[email protected]>
Cc: Chris Li <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Kairui Song <[email protected]>
Cc: Kemeng Shi <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Nhat Pham <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Shakeel Butt <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: "Uladzislau Rezki (Sony)" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
Lorenzo Stoakes (ARM)
2026-08-24 18:43:03 -07:00
committed by Andrew Morton
parent b9183788a2
commit 6fd3e592c0
7 changed files with 12 additions and 0 deletions
+1
View File
@@ -2,6 +2,7 @@
#ifndef __MM_CMA_H__
#define __MM_CMA_H__
#include <linux/cma.h>
#include <linux/debugfs.h>
#include <linux/kobject.h>
+2
View File
@@ -2,6 +2,8 @@
#ifndef _LINUX_HUGETLB_CMA_H
#define _LINUX_HUGETLB_CMA_H
#include <linux/hugetlb.h>
#ifdef CONFIG_CMA
void hugetlb_cma_free_frozen_folio(struct folio *folio);
struct folio *hugetlb_cma_alloc_frozen_folio(int order, gfp_t gfp_mask,
+1
View File
@@ -4,6 +4,7 @@
#define __MM_MEMCONTROL_V1_H
#include <linux/cgroup-defs.h>
#include <linux/memcontrol.h>
/* Cgroup v1 and v2 common declarations */
+3
View File
@@ -2,6 +2,9 @@
#ifndef _LINUX_PGALLOC_TRACK_H
#define _LINUX_PGALLOC_TRACK_H
#include <linux/mm.h>
#include <linux/pgtable.h>
#if defined(CONFIG_MMU)
static inline p4d_t *p4d_alloc_track(struct mm_struct *mm, pgd_t *pgd,
unsigned long address,
+2
View File
@@ -2,7 +2,9 @@
// Copyright(c) 2018 Intel Corporation. All rights reserved.
#ifndef _MM_SHUFFLE_H
#define _MM_SHUFFLE_H
#include <linux/jump_label.h>
#include <linux/mmzone.h>
#define SHUFFLE_ORDER MAX_PAGE_ORDER
+1
View File
@@ -5,6 +5,7 @@
#include <linux/atomic.h> /* for atomic_long_t */
#include <linux/mm.h> /* for PAGE_SHIFT */
#include <linux/memcontrol.h> /* for mem_cgroup_swappiness() */
#include <linux/swap.h> /* for MAX_SWAPFILES_SHIFT, struct swap_info_struct */
struct mempolicy;
struct swap_iocb;
+2
View File
@@ -5,6 +5,8 @@
#ifndef __MM_VMALLOC_H
#define __MM_VMALLOC_H
#include <linux/vmalloc.h>
#ifdef CONFIG_MMU
void __init vmalloc_init(void);
int __must_check vmap_pages_range_noflush(unsigned long addr, unsigned long end,