buffer: Add folio_buffers()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 9 Feb 2022 20:21:26 +0000 (20:21 +0000)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 14 Mar 2022 19:43:16 +0000 (15:43 -0400)
While there is no intent to use large folios in filesystems using buffer
heads, converting the filesystems to use single-page folios is still worth
doing to remove legacy infrastructure and hidden calls to compound_head().
These helper functions are needed for that conversion to take place.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
include/linux/buffer_head.h

index 36f3368..3451f1f 100644 (file)
@@ -144,6 +144,7 @@ BUFFER_FNS(Defer_Completion, defer_completion)
                ((struct buffer_head *)page_private(page));     \
        })
 #define page_has_buffers(page) PagePrivate(page)
+#define folio_buffers(folio)           folio_get_private(folio)
 
 void buffer_check_dirty_writeback(struct page *page,
                                     bool *dirty, bool *writeback);