On Sun, Nov 12, 2023 at 04:52:56AM +0000, Matthew Wilcox wrote: > On Sat, Nov 11, 2023 at 10:06:13AM -0800, Eric Biggers wrote: > > On Fri, Nov 10, 2023 at 02:26:43PM +0000, Matthew Wilcox wrote: > > > Would you want to invest more engineering time in changing it? > > > > It seems logical to just keep the existing approach instead of spending time > > trying to justify changing it to a less efficient one (divides). > > Except the existing approach doesn't work for block size > PAGE_SIZE A shift does still work; the block size is still a power of 2, after all. '(sector_t)folio->index << (PAGE_SHIFT - bbits)' just needs to be changed to 'folio_pos(folio) >> bbits'. - Eric