]> git.dujemihanovic.xyz Git - linux.git/commitdiff
include/linux/mm.h: move nr_free_buffer_pages from swap.h to mm.h
authorMianhan Liu <liumh1@shanghaitech.edu.cn>
Fri, 5 Nov 2021 20:45:21 +0000 (13:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:43 +0000 (13:30 -0700)
nr_free_buffer_pages could be exposed through mm.h instead of swap.h.
The advantage of this change is that it can reduce the obsolete
includes.  For example, net/ipv4/tcp.c wouldn't need swap.h any more
since it has already included mm.h.  Similarly, after checking all the
other files, it comes that tcp.c, udp.c meter.c ,...  follow the same
rule, so these files can have swap.h removed too.

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.  This change will not affect the compilation of other files.

Link: https://lkml.kernel.org/r/20210912133640.1624-1-liumh1@shanghaitech.edu.cn
Signed-off-by: Mianhan Liu <liumh1@shanghaitech.edu.cn>
Cc: Jakub Kicinski <kuba@kernel.org>
CC: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "David S . Miller" <davem@davemloft.net>
Cc: Simon Horman <horms@verge.net.au>
Cc: Pravin B Shelar <pshelar@ovn.org>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/mmc/core/mmc_test.c
include/linux/mm.h
include/linux/swap.h
net/ipv4/tcp.c
net/ipv4/udp.c
net/netfilter/ipvs/ip_vs_ctl.c
net/openvswitch/meter.c
net/sctp/protocol.c

index 63524551a13a16baa256428d9ac93ee461481edb..e6a2fd2c6d5c94b62374314c3cd11ed19502abdb 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/slab.h>
 
 #include <linux/scatterlist.h>
-#include <linux/swap.h>                /* For nr_free_buffer_pages() */
 #include <linux/list.h>
 
 #include <linux/debugfs.h>
index 15058d9cec99bf79ed2d8dd63268d001051a5d26..b1720aa63727611e61982f4e6a7f17477e387b99 100644 (file)
@@ -875,6 +875,8 @@ void put_pages_list(struct list_head *pages);
 void split_page(struct page *page, unsigned int order);
 void copy_huge_page(struct page *dst, struct page *src);
 
+unsigned long nr_free_buffer_pages(void);
+
 /*
  * Compound pages have a destructor function.  Provide a
  * prototype for that function and accessor functions.
index ba52f3a3478e313920222b389e2646750eee4337..53f759a5999664afca5b477213fe136334eaa6c5 100644 (file)
@@ -335,7 +335,6 @@ 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)
index f5c336f8b0c8e95d8b3f1faeaf1d2d147d313781..c5e07a2c6c524e583fe835d80fa1fac54020fb8b 100644 (file)
 #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>
index 2fffcf2b54f3f304c6643d04d2c066d4ea6f5de4..319dd7bbfe33d64d25c36bc3a1cd3bd4caf0a779 100644 (file)
@@ -78,7 +78,6 @@
 #include <asm/ioctls.h>
 #include <linux/memblock.h>
 #include <linux/highmem.h>
-#include <linux/swap.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/module.h>
index 29ec3ef63edc7a6b59b37bd0eb5e95b25e32bf57..6ea4b882435e77008d2e74f5380bcbb62a209547 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
 #include <linux/workqueue.h>
-#include <linux/swap.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 
index 896b8f5bc885350980a9547fc921583515dff7ec..04a060ac7fdf6e1f7de8fbf19880870ece8ea520 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/openvswitch.h>
 #include <linux/netlink.h>
 #include <linux/rculist.h>
-#include <linux/swap.h>
 
 #include <net/netlink.h>
 #include <net/genetlink.h>
index ec0f52567c16ffbd372e9901faa370a24c60cf39..35928fefae3327f97688f0857de63bc17e3429d6 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/seq_file.h>
 #include <linux/memblock.h>
 #include <linux/highmem.h>
-#include <linux/swap.h>
 #include <linux/slab.h>
 #include <net/net_namespace.h>
 #include <net/protocol.h>