Re: [RFC 2/4] buffer: add alloc_folio_buffers() helper

Pankaj Raghav
2023-04-14T15:01:56Z

On 2023-04-14 15:06, Matthew Wilcox wrote:
> On Fri, Apr 14, 2023 at 01:08:19PM +0200, Pankaj Raghav wrote:
>> Folio version of alloc_page_buffers() helper. This is required to convert
>> create_page_buffers() to create_folio_buffers() later in the series.
>>
>> It removes one call to compound_head() compared to alloc_page_buffers().
>
> I would convert alloc_page_buffers() to folio_alloc_buffers() and
> add
>
> static struct buffer_head *alloc_page_buffers(struct page *page,
> unsigned long size, bool retry)
> {
> return folio_alloc_buffers(page_folio(page), size, retry);
> }
>
> in buffer_head.h
>
> (there are only five callers, so this feels like a better tradeoff
> than creating a new function)
>
That is a good idea and follows the usual pattern for folio conversion. I will
send a new version soon with your other comments as well.

--
Pankaj