Re: [PATCH 07/26] gfs2; Convert gfs2_getjdatabuf to use a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!



[Index of Archives]     [Linux Filesystem Development]     [Linux BTRFS]     [Linux CIFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux