Skip to content

Commit

Permalink
mmap: make mlock_future_check() global
Browse files Browse the repository at this point in the history
It will be used by the upcoming secret memory implementation.

Link: https://lkml.kernel.org/r/20210121122723.3446-3-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christopher Lameter <cl@linux.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tycho Andersen <tycho@tycho.ws>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
Mike Rapoport authored and Stephen Rothwell committed Feb 8, 2021
1 parent 4e27def commit fd74de3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions mm/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)
extern void mlock_vma_page(struct page *page);
extern unsigned int munlock_vma_page(struct page *page);

extern int mlock_future_check(struct mm_struct *mm, unsigned long flags,
unsigned long len);

/*
* Clear the page's PageMlocked(). This can be useful in a situation where
* we want to unconditionally remove a page from the pagecache -- e.g.,
Expand Down
5 changes: 2 additions & 3 deletions mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,9 +1346,8 @@ static inline unsigned long round_hint_to_min(unsigned long hint)
return hint;
}

static inline int mlock_future_check(struct mm_struct *mm,
unsigned long flags,
unsigned long len)
int mlock_future_check(struct mm_struct *mm, unsigned long flags,
unsigned long len)
{
unsigned long locked, lock_limit;

Expand Down

0 comments on commit fd74de3

Please sign in to comment.