On Wed, Sep 05, 2018 at 09:23:26AM -0500, Eric Sandeen wrote: > > block0 = page->index; > > block0 <<= shift; > > > > - block = inode->i_mapping->a_ops->bmap(inode->i_mapping, block0); > > + block = bmap(inode, block0); > > Prior to this there's an ASSERT that inode->i_mapping->a_ops->bmap > exists. Should that stay, if the goal is to move all ->bmap use out > of calling code? I think it needs to go away. > OTOH, what will this code do if bmap() finds that there > is no ->bmap present and returns 0? I think we just need to fix the bmap() prototype so that it can return error, which would be very useful for various reasons. Something like this: int bmap(struct address_space *mapping, sector_t *block) { if (!mapping->a_ops->bmap) return -EINVAL; *block = mapping->a_ops->bmap(mapping, *block); return 0; } then add fiemap support with real error handling later.