mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
4e1364286d
Convert unlock_page() to call folio_unlock(). By using a folio we avoid a call to compound_head(). This shortens the function from 39 bytes to 25 and removes 4 instructions on x86-64. Because we still have unlock_page(), it's a net increase of 16 bytes of text for the kernel as a whole, but any path that uses folio_unlock() will execute 4 fewer instructions. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Jeff Layton <jlayton@kernel.org> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reviewed-by: William Kucharski <william.kucharski@oracle.com> Reviewed-by: David Howells <dhowells@redhat.com> Acked-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Vlastimil Babka <vbabka@suse.cz>
20 lines
439 B
C
20 lines
439 B
C
/*
|
|
* Compatibility functions which bloat the callers too much to make inline.
|
|
* All of the callers of these functions should be converted to use folios
|
|
* eventually.
|
|
*/
|
|
|
|
#include <linux/pagemap.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));
|
|
}
|
|
EXPORT_SYMBOL(unlock_page);
|