Re: [PATCH 07/26] gfs2; Convert gfs2_getjdatabuf to use a folio
Matthew Wilcox <[email protected]> Wed, 20 Sep 2023 04:11:11 +0100
| Newsgroups | org.kernel.vger.reiserfs-devel,dev.linux.lists.gfs2,dev.linux.lists.ntfs3,dev.linux.lists.ocfs2-devel,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-nilfs |
|---|---|
| Message-ID | <ZQpizwzZ/[email protected]> |
On Wed, Sep 20, 2023 at 12:27:08AM +0200, Andreas Gruenbacher wrote:
> Thanks,
>
> but this patch has an unwanted semicolon in the subject.
Thanks. My laptop has a dodgy shift key, so this sometimes happens.
The build quality on HP Spectre laptops has gone downhill in the last
few years.
> > - page = find_get_page_flags(mapping, index, FGP_LOCK|FGP_ACCESSED);
> > - if (!page)
> > - return NULL;
> > - if (!page_has_buffers(page)) {
> > - unlock_page(page);
> > - put_page(page);
> > + folio = __filemap_get_folio(mapping, index, FGP_LOCK | FGP_ACCESSED, 0);
> > + if (IS_ERR(folio))
> > return NULL;
> > - }
> > - /* Locate header for our buffer within our page */
> > - for (bh = page_buffers(page); bufnum--; bh = bh->b_this_page)
> > - /* Do nothing */;
> > - get_bh(bh);
> > - unlock_page(page);
> > - put_page(page);
> > + bh = folio_buffers(folio);
> > + if (bh)
> > + get_nth_bh(bh, bufnum);
>
> And we need this here:
>
> bh = get_nth_bh(bh, bufnum);
Oof. I should make that __must_check so the compiler tells me I'm being
an idiot.
Thanks!