]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: remove page_mapping()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 24 May 2024 18:18:10 +0000 (19:18 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:29:59 +0000 (19:29 -0700)
All callers are now converted, delete this compatibility wrapper.  Also
fix up some comments which referred to page_mapping.

Link: https://lkml.kernel.org/r/20240423225552.4113447-7-willy@infradead.org
Link: https://lkml.kernel.org/r/20240524181813.698813-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm/include/asm/cacheflush.h
arch/arm64/include/asm/cacheflush.h
arch/mips/mm/cache.c
arch/sparc/mm/init_64.c
include/linux/buffer_head.h
include/linux/page-flags.h
include/linux/pagemap.h
mm/folio-compat.c

index 1075534b0a2eeba73be7d0e83b9d0c995e1f8cf9..8ed8b9a24efeb9f2118b38abcf75df0359081225 100644 (file)
@@ -283,7 +283,7 @@ void flush_cache_pages(struct vm_area_struct *vma, unsigned long user_addr,
  * flush_dcache_page is used when the kernel has written to the page
  * cache page at virtual address page->virtual.
  *
- * If this page isn't mapped (ie, page_mapping == NULL), or it might
+ * If this page isn't mapped (ie, folio_mapping == NULL), or it might
  * have userspace mappings, then we _must_ always clean + invalidate
  * the dcache entries associated with the kernel mapping.
  *
index fefac75fa009f44cf78805a35c3ca1ef0d914c44..28ab96e808eff50621700aff6546728d6e298c87 100644 (file)
@@ -117,7 +117,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *,
  * flush_dcache_folio is used when the kernel has written to the page
  * cache page at virtual address page->virtual.
  *
- * If this page isn't mapped (ie, page_mapping == NULL), or it might
+ * If this page isn't mapped (ie, folio_mapping == NULL), or it might
  * have userspace mappings, then we _must_ always clean + invalidate
  * the dcache entries associated with the kernel mapping.
  *
index df1ced4fc3b50618ff2c8df995a14ae06713dafa..bf9a37c60e9f091ad3012d398cbe16856b8552e5 100644 (file)
@@ -112,7 +112,7 @@ void __flush_dcache_pages(struct page *page, unsigned int nr)
        }
 
        /*
-        * We could delay the flush for the !page_mapping case too.  But that
+        * We could delay the flush for the !folio_mapping case too.  But that
         * case is for exec env/arg pages and those are %99 certainly going to
         * get faulted into the tlb (and thus flushed) anyways.
         */
index 00b247d924a9abb220777f91f20ae66efc26965e..53d7cb5bbffe5aaefd683f5c520690ec0cafa2ba 100644 (file)
@@ -490,7 +490,7 @@ void flush_dcache_folio(struct folio *folio)
                }
                set_dcache_dirty(folio, this_cpu);
        } else {
-               /* We could delay the flush for the !page_mapping
+               /* We could delay the flush for the !folio_mapping
                 * case too.  But that case is for exec env/arg
                 * pages and those are %99 certainly going to get
                 * faulted into the tlb (and thus flushed) anyways.
index e022e40b099e335c1232b8a14c9f51008fdb187c..14acf1bbe0ce699236fd58406b1f96e1c7fac6b0 100644 (file)
@@ -53,7 +53,7 @@ typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
  * filesystem and block layers.  Nowadays the basic I/O unit
  * is the bio, and buffer_heads are used for extracting block
  * mappings (via a get_block_t call), for tracking state within
- * a page (via a page_mapping) and for wrapping bio submission
+ * a folio (via a folio_mapping) and for wrapping bio submission
  * for backward compatibility reasons (e.g. submit_bh).
  */
 struct buffer_head {
index b9e914e1face8d44f51dab37f31ff4df0753387b..813eea2efe264e5e2764122b66f086d0ece20b50 100644 (file)
@@ -655,27 +655,28 @@ PAGEFLAG_FALSE(VmemmapSelfHosted, vmemmap_self_hosted)
 #endif
 
 /*
- * On an anonymous page mapped into a user virtual memory area,
- * page->mapping points to its anon_vma, not to a struct address_space;
+ * On an anonymous folio mapped into a user virtual memory area,
+ * folio->mapping points to its anon_vma, not to a struct address_space;
  * with the PAGE_MAPPING_ANON bit set to distinguish it.  See rmap.h.
  *
  * On an anonymous page in a VM_MERGEABLE area, if CONFIG_KSM is enabled,
  * the PAGE_MAPPING_MOVABLE bit may be set along with the PAGE_MAPPING_ANON
- * bit; and then page->mapping points, not to an anon_vma, but to a private
+ * bit; and then folio->mapping points, not to an anon_vma, but to a private
  * structure which KSM associates with that merged page.  See ksm.h.
  *
  * PAGE_MAPPING_KSM without PAGE_MAPPING_ANON is used for non-lru movable
- * page and then page->mapping points to a struct movable_operations.
+ * page and then folio->mapping points to a struct movable_operations.
  *
- * Please note that, confusingly, "page_mapping" refers to the inode
- * address_space which maps the page from disk; whereas "page_mapped"
- * refers to user virtual address space into which the page is mapped.
+ * Please note that, confusingly, "folio_mapping" refers to the inode
+ * address_space which maps the folio from disk; whereas "folio_mapped"
+ * refers to user virtual address space into which the folio is mapped.
  *
  * For slab pages, since slab reuses the bits in struct page to store its
- * internal states, the page->mapping does not exist as such, nor do these
- * flags below.  So in order to avoid testing non-existent bits, please
- * make sure that PageSlab(page) actually evaluates to false before calling
- * the following functions (e.g., PageAnon).  See mm/slab.h.
+ * internal states, the folio->mapping does not exist as such, nor do
+ * these flags below.  So in order to avoid testing non-existent bits,
+ * please make sure that folio_test_slab(folio) actually evaluates to
+ * false before calling the following functions (e.g., folio_test_anon).
+ * See mm/slab.h.
  */
 #define PAGE_MAPPING_ANON      0x1
 #define PAGE_MAPPING_MOVABLE   0x2
index 1586b5c21e8161b963395c3f61c7763e9a737f64..e37e16ebff7aeae2707c3d3409744ebcee61a982 100644 (file)
@@ -426,7 +426,6 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping)
 #endif
 }
 
-struct address_space *page_mapping(struct page *);
 struct address_space *folio_mapping(struct folio *);
 struct address_space *swapcache_mapping(struct folio *);
 
index f31e0ce65b11d4835aef82188e92083ba0776598..f05906006b3c3303c902f9a5fec9f1929fa9984a 100644 (file)
 #include <linux/swap.h>
 #include "internal.h"
 
-struct address_space *page_mapping(struct page *page)
-{
-       return folio_mapping(page_folio(page));
-}
-EXPORT_SYMBOL(page_mapping);
-
 void unlock_page(struct page *page)
 {
        return folio_unlock(page_folio(page));