Re: [PATCHv9 6/6] iomap: Add per-block dirty state tracking to improve performance

Matthew Wilcox
2023-06-12T16:27:39Z

On Sat, Jun 10, 2023 at 05:09:07PM +0530, Ritesh Harjani (IBM) wrote:
> +static void iomap_ifs_calc_range(struct folio *folio, size_t off, size_t len,
> + enum iomap_block_state state, unsigned int *first_blkp,
> + unsigned int *nr_blksp)
> +{
> + struct inode *inode = folio->mapping->host;
> + unsigned int blks_per_folio = i_blocks_per_folio(inode, folio);
> + unsigned int first_blk = off >> inode->i_blkbits;
> + unsigned int last_blk = (off + len - 1) >> inode->i_blkbits;
> +
> + *first_blkp = first_blk + (state * blks_per_folio);

This _isn't_ first_blk. It's first_bit. You could just rename it to
'first', but misnaming it as first_blkp is going to confuse.