]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: Handle per-folio private data
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 11 Jan 2021 15:04:40 +0000 (10:04 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 13 Aug 2021 18:19:48 +0000 (14:19 -0400)
commit85aee17208e72eb39fc33eb191c856dfc6e9d65f
tree841da6f5683a769fb81616a014d3660252d92986
parentbad0aa09b2e867b6929bc0b585f7216100c069f3
mm: Handle per-folio private data

Add folio_get_private() which mirrors page_private() -- ie folio private
data is the same as page private data.  The only difference is that these
return a void * instead of an unsigned long, which matches the majority
of users.

Turn attach_page_private() into folio_attach_private() and reimplement
attach_page_private() as a wrapper.  No filesystem which uses page private
data currently supports compound pages, so we're free to define the rules.
attach_page_private() may only be called on a head page; if you want
to add private data to a tail page, you can call set_page_private()
directly (and shouldn't increment the page refcount!  That should be
done when adding private data to the head page / folio).

This saves 813 bytes of text with the distro-derived config that I'm
testing due to removing the calls to compound_head() in get_page()
& put_page().

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>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
include/linux/mm_types.h
include/linux/pagemap.h