@@ -871,6 +871,7 @@ void put_pages_list(struct list_head *pages);
void split_page(struct page *page, unsigned int order);
void folio_copy(struct folio *dst, struct folio *src);
+extern unsigned long nr_free_buffer_pages(void);
/*
* Compound pages have a destructor function. Provide a
* prototype for that function and accessor functions.
@@ -341,7 +341,7 @@ void workingset_update_node(struct xa_node *node);
/* linux/mm/page_alloc.c */
extern unsigned long totalreserve_pages;
-extern unsigned long nr_free_buffer_pages(void);
+
/* Definition of global_zone_page_state not available yet */
#define nr_free_pages() global_zone_page_state(NR_FREE_PAGES)
@@ -260,7 +260,6 @@
#include <linux/random.h>
#include <linux/memblock.h>
#include <linux/highmem.h>
-#include <linux/swap.h>
#include <linux/cache.h>
#include <linux/err.h>
#include <linux/time.h>
nr_free_buffer_pages could be exposed through mm.h instead of swap.h, and then tcp.c wouldn't need swap.h. Moreover, after preprocessing all the files that use nr_free_buffer_pages, it turns out that those files have already included mm.h. Thus, we can move nr_free_buffer_pages from swap.h to mm.h safely so as to reduce the obsolete includes. Signed-off-by: MianHan Liu <liumh1@shanghaitech.edu.cn> --- include/linux/mm.h | 1 + include/linux/swap.h | 2 +- net/ipv4/tcp.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-)