On Thu, Feb 26, 2026 at 06:49:34AM -0800, Christoph Hellwig wrote:
> +             block_in_file = EXT4_PG_TO_LBLK(inode, folio->index);
> +             pos = (loff_t)block_in_file << blkbits;

The EXT4_PG_TO_LBLK() expands to:

        (((loff_t)(folio->index) << PAGE_SHIFT) >> (inode)->i_blkbits)

So it calculates the pos as an intermediate step, and we end up with the
redundant pos = (pos >> blkbits) << blkbits.

It probably would make more sense to calculate the pos first, similar to
what other places in this series do:

        pos = folio_pos(folio);                                          
        block_in_file = pos >> blkbits;

- Eric

Reply via email to