On Sat, Dec 13, 2014 at 07:11:11PM -0800, Darrick J. Wong wrote: > > But if you look at the above code, there is nothing which is inode or > > handle specific. The value is only dependent on fs->blocksize. But > > to calculate this value the function calls ul_log2 three times, which > > is implemented using a looping construct. So we will be recalculating > > what is effectively a constant value every single inode in an ext4 > > file system, which seems very unfortunate. > > How about I save the last fs->blocksize and the last result, and return the > cached last result if fs->blocksize == lastblocksize? That sounds like a plan. BTW, it looks like I had accidentally included this in the next branch, but adding a cache won't disturb the API, so that's fine. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html