Skip to content

Commit 3a4f8a0

Browse files
Hugh Dickinstorvalds
authored andcommitted
mm: remove shmem_mapping() shmem_zero_setup() duplicates
Remove the prototypes for shmem_mapping() and shmem_zero_setup() from linux/mm.h, since they are already provided in linux/shmem_fs.h. But shmem_fs.h must then provide the inline stub for shmem_mapping() when CONFIG_SHMEM is not set, and a few more cfiles now need to #include it. Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1702081658250.1549@eggly.anvils Signed-off-by: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Simek <monstr@monstr.eu> Cc: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e02dc01 commit 3a4f8a0

9 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎arch/microblaze/pci/pci-common.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/init.h>
2323
#include <linux/bootmem.h>
2424
#include <linux/mm.h>
25+
#include <linux/shmem_fs.h>
2526
#include <linux/list.h>
2627
#include <linux/syscalls.h>
2728
#include <linux/irq.h>

‎arch/powerpc/kernel/pci-common.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/of_address.h>
2626
#include <linux/of_pci.h>
2727
#include <linux/mm.h>
28+
#include <linux/shmem_fs.h>
2829
#include <linux/list.h>
2930
#include <linux/syscalls.h>
3031
#include <linux/irq.h>

‎include/linux/mm.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,16 +1168,6 @@ extern void pagefault_out_of_memory(void);
11681168

11691169
extern void show_free_areas(unsigned int flags, nodemask_t *nodemask);
11701170

1171-
int shmem_zero_setup(struct vm_area_struct *);
1172-
#ifdef CONFIG_SHMEM
1173-
bool shmem_mapping(struct address_space *mapping);
1174-
#else
1175-
static inline bool shmem_mapping(struct address_space *mapping)
1176-
{
1177-
return false;
1178-
}
1179-
#endif
1180-
11811171
extern bool can_do_mlock(void);
11821172
extern int user_shm_lock(size_t, struct user_struct *);
11831173
extern void user_shm_unlock(size_t, struct user_struct *);

‎include/linux/shmem_fs.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ extern int shmem_zero_setup(struct vm_area_struct *);
5757
extern unsigned long shmem_get_unmapped_area(struct file *, unsigned long addr,
5858
unsigned long len, unsigned long pgoff, unsigned long flags);
5959
extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
60+
#ifdef CONFIG_SHMEM
6061
extern bool shmem_mapping(struct address_space *mapping);
62+
#else
63+
static inline bool shmem_mapping(struct address_space *mapping)
64+
{
65+
return false;
66+
}
67+
#endif /* CONFIG_SHMEM */
6168
extern void shmem_unlock_mapping(struct address_space *mapping);
6269
extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
6370
pgoff_t index, gfp_t gfp_mask);

‎mm/madvise.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/backing-dev.h>
2222
#include <linux/swap.h>
2323
#include <linux/swapops.h>
24+
#include <linux/shmem_fs.h>
2425
#include <linux/mmu_notifier.h>
2526

2627
#include <asm/tlb.h>

‎mm/memcontrol.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/memcontrol.h>
3636
#include <linux/cgroup.h>
3737
#include <linux/mm.h>
38+
#include <linux/shmem_fs.h>
3839
#include <linux/hugetlb.h>
3940
#include <linux/pagemap.h>
4041
#include <linux/smp.h>

‎mm/mincore.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/syscalls.h>
1515
#include <linux/swap.h>
1616
#include <linux/swapops.h>
17+
#include <linux/shmem_fs.h>
1718
#include <linux/hugetlb.h>
1819

1920
#include <linux/uaccess.h>

‎mm/truncate.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/task_io_accounting_ops.h>
2121
#include <linux/buffer_head.h> /* grr. try_to_release_page,
2222
do_invalidatepage */
23+
#include <linux/shmem_fs.h>
2324
#include <linux/cleancache.h>
2425
#include <linux/rmap.h>
2526
#include "internal.h"

‎mm/workingset.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/memcontrol.h>
88
#include <linux/writeback.h>
9+
#include <linux/shmem_fs.h>
910
#include <linux/pagemap.h>
1011
#include <linux/atomic.h>
1112
#include <linux/module.h>

0 commit comments

Comments
 (0)