[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a04dc769-9c4a-15e6-ad88-1cf11c646299@suse.de>
Date: Mon, 17 Apr 2023 08:04:42 +0200
From: Hannes Reinecke <hare@...e.de>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: Pankaj Raghav <p.raghav@...sung.com>, brauner@...nel.org,
willy@...radead.org, viro@...iv.linux.org.uk,
akpm@...ux-foundation.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, gost.dev@...sung.com
Subject: Re: [RFC 0/4] convert create_page_buffers to create_folio_buffers
On 4/17/23 04:27, Luis Chamberlain wrote:
> On Fri, Apr 14, 2023 at 03:47:13PM +0200, Hannes Reinecke wrote:
>> @@ -2333,13 +2395,15 @@ int block_read_full_folio(struct folio *folio,
>> get_block_t *get_block)
>> if (IS_ENABLED(CONFIG_FS_VERITY) && IS_VERITY(inode))
>> limit = inode->i_sb->s_maxbytes;
>>
>> - VM_BUG_ON_FOLIO(folio_test_large(folio), folio);
>> -
>> head = create_folio_buffers(folio, inode, 0);
>> blocksize = head->b_size;
>> bbits = block_size_bits(blocksize);
>>
>> - iblock = (sector_t)folio->index << (PAGE_SHIFT - bbits);
>> + if (WARN_ON(PAGE_SHIFT < bbits)) {
>> + iblock = (sector_t)folio->index >> (bbits - PAGE_SHIFT);
>> + } else {
>> + iblock = (sector_t)folio->index << (PAGE_SHIFT - bbits);
>> + }
>> lblock = (limit+blocksize-1) >> bbits;
>> bh = head;
>> nr = 0;
>
> BTW I See this pattern in:
>
> fs/mpage.c: do_mpage_readpage()
> fs/mpage.c: __mpage_writepage()
>
> A helper might be in order.
>
But only _iff_ we decide to stick with buffer_heads and upgrade the
buffer_head code to handle multi-page block sizes.
The idea was to move over to iomap, hence I'm not sure into which
lengths we should go keeping buffer_heads alive ...
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
Powered by blists - more mailing lists