mm: reimplement compound_nr()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 11 Jan 2023 14:29:03 +0000 (14:29 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:32:58 +0000 (22:32 -0800)
commit21a000fe97a018c6d25be63892afb4fd8210ab57
tree18836ef21f41ed7bf54d4f19521c5d2d63c7f3c8
parent5eb5cea11dcbafaa37685bc4e89e1d4ae9c434ea
mm: reimplement compound_nr()

Turn compound_nr() into a wrapper around folio_nr_pages().  Similarly to
compound_order(), casting the struct page directly to struct folio
preserves the existing behaviour, while calling page_folio() would change
the behaviour.  Move thp_nr_pages() down in the file so that compound_nr()
can be after folio_nr_pages().

[willy@infradead.org: fix assertion triggering]
Link: https://lkml.kernel.org/r/Y8AFgZEEjnUIaCbf@casper.infradead.org
Link: https://lkml.kernel.org/r/20230111142915.1001531-18-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mm.h