Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: add prototype for __add_to_page_cache_locked()

Otherwise it causes a gcc warning:

mm/filemap.c:830:14: warning: no previous prototype for `__add_to_page_cache_locked' [-Wmissing-prototypes]

A previous attempt to make this function static led to compilation
errors when CONFIG_DEBUG_INFO_BTF is enabled because
__add_to_page_cache_locked() is referred to by BPF code.

Adding a prototype will silence the warning.

Link: https://lkml.kernel.org/r/1608693702-4665-1-git-send-email-jrdr.linux@gmail.com
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Alex Shi <alex.shi@linux.alibaba.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>

authored by

Souptick Joarder and committed by
Linus Torvalds
6d87d0ec 5dbdb2d8

+7
+7
include/linux/mm.h
··· 216 216 loff_t *); 217 217 int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *, 218 218 loff_t *); 219 + /* 220 + * Any attempt to mark this function as static leads to build failure 221 + * when CONFIG_DEBUG_INFO_BTF is enabled because __add_to_page_cache_locked() 222 + * is referred to by BPF code. This must be visible for error injection. 223 + */ 224 + int __add_to_page_cache_locked(struct page *page, struct address_space *mapping, 225 + pgoff_t index, gfp_t gfp, void **shadowp); 219 226 220 227 #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) 221 228