Skip to content

Commit

Permalink
mm: remove PageMovable export
Browse files Browse the repository at this point in the history
The only in-kernel users that need PageMovable() to be exported are z3fold
and zsmalloc and they are only using it for dubious debugging
functionality.  So remove those usages and the export so that no driver
code accidentally thinks that they are allowed to use this symbol.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Reviewed-by: Miaohe Lin <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Cc: Vitaly Wool <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
gregkh authored and akpm00 committed Jan 19, 2023
1 parent 02d65d6 commit 61d3d51
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ bool PageMovable(struct page *page)

return false;
}
EXPORT_SYMBOL(PageMovable);

void __SetPageMovable(struct page *page, const struct movable_operations *mops)
{
Expand Down
2 changes: 0 additions & 2 deletions mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,6 @@ static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode)
struct z3fold_header *zhdr;
struct z3fold_pool *pool;

VM_BUG_ON_PAGE(!PageMovable(page), page);
VM_BUG_ON_PAGE(PageIsolated(page), page);

if (test_bit(PAGE_HEADLESS, &page->private))
Expand Down Expand Up @@ -1490,7 +1489,6 @@ static int z3fold_page_migrate(struct page *newpage, struct page *page,
struct z3fold_header *zhdr, *new_zhdr;
struct z3fold_pool *pool;

VM_BUG_ON_PAGE(!PageMovable(page), page);
VM_BUG_ON_PAGE(!PageIsolated(page), page);
VM_BUG_ON_PAGE(!test_bit(PAGE_CLAIMED, &page->private), page);
VM_BUG_ON_PAGE(!PageLocked(newpage), newpage);
Expand Down
3 changes: 0 additions & 3 deletions mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,6 @@ static bool zs_page_isolate(struct page *page, isolate_mode_t mode)
* Page is locked so zspage couldn't be destroyed. For detail, look at
* lock_zspage in free_zspage.
*/
VM_BUG_ON_PAGE(!PageMovable(page), page);
VM_BUG_ON_PAGE(PageIsolated(page), page);

zspage = get_zspage(page);
Expand Down Expand Up @@ -2005,7 +2004,6 @@ static int zs_page_migrate(struct page *newpage, struct page *page,
if (mode == MIGRATE_SYNC_NO_COPY)
return -EINVAL;

VM_BUG_ON_PAGE(!PageMovable(page), page);
VM_BUG_ON_PAGE(!PageIsolated(page), page);

/* The page is locked, so this pointer must remain valid */
Expand Down Expand Up @@ -2070,7 +2068,6 @@ static void zs_page_putback(struct page *page)
{
struct zspage *zspage;

VM_BUG_ON_PAGE(!PageMovable(page), page);
VM_BUG_ON_PAGE(!PageIsolated(page), page);

zspage = get_zspage(page);
Expand Down

0 comments on commit 61d3d51

Please sign in to comment.