mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 10:38:44 -04:00
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "5 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: include/asm-generic/topology.h: guard cpumask_of_node() macro argument fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info() mm: remove VM_BUG_ON(PageSlab()) from page_mapcount() mm,thp: stop leaking unreleased file pages mm/z3fold: silence kmemleak false positives of slots
This commit is contained in:
@@ -782,6 +782,11 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
|
||||
|
||||
extern void kvfree(const void *addr);
|
||||
|
||||
/*
|
||||
* Mapcount of compound page as a whole, does not include mapped sub-pages.
|
||||
*
|
||||
* Must be called only for compound pages or any their tail sub-pages.
|
||||
*/
|
||||
static inline int compound_mapcount(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(!PageCompound(page), page);
|
||||
@@ -801,10 +806,16 @@ static inline void page_mapcount_reset(struct page *page)
|
||||
|
||||
int __page_mapcount(struct page *page);
|
||||
|
||||
/*
|
||||
* Mapcount of 0-order page; when compound sub-page, includes
|
||||
* compound_mapcount().
|
||||
*
|
||||
* Result is undefined for pages which cannot be mapped into userspace.
|
||||
* For example SLAB or special types of pages. See function page_has_type().
|
||||
* They use this place in struct page differently.
|
||||
*/
|
||||
static inline int page_mapcount(struct page *page)
|
||||
{
|
||||
VM_BUG_ON_PAGE(PageSlab(page), page);
|
||||
|
||||
if (unlikely(PageCompound(page)))
|
||||
return __page_mapcount(page);
|
||||
return atomic_read(&page->_mapcount) + 1;
|
||||
|
||||
Reference in New Issue
Block a user