Re: [PATCH v2 2/9] fs: Introduce i_blocks_per_page

From: Matthew Wilcox
Date: Tue Sep 15 2020 - 18:41:43 EST


On Tue, Sep 15, 2020 at 03:40:52PM +0000, David Laight wrote:
> > @@ -147,7 +147,7 @@ iomap_iop_set_range_uptodate(struct page *page, unsigned off, unsigned len)
> > unsigned int i;
> >
> > spin_lock_irqsave(&iop->uptodate_lock, flags);
> > - for (i = 0; i < PAGE_SIZE / i_blocksize(inode); i++) {
> > + for (i = 0; i < i_blocks_per_page(inode, page); i++) {
>
> You probably don't want to call the helper every time
> around the loop.

This is a classic example of focusing on the details and missing the
larger picture. We don't want the loop at all, and if you'd kept reading
the patch series, you'd see it disappear later.