On Mon, Nov 06, 2017 at 11:26:54PM +0200, Nikolay Borisov wrote: > > > On 6.11.2017 21:30, David Sterba wrote: > > There are several functions that take a generic get_extent parameter, but not > > all of them use it to distinguish between btree_get_exnent (for metadata) and > > btrfs_get_extent (for data). This is namely extent_read_full_page and > > __do_readpage. > > I wonder whether we can do some similar collpasing withe some of the > hooks we have i.e. readpage_end_io_hook (resp. > btrfs_readpage_end_io_hook and btree_readpage_end_io_hook). All those > callbacks don't necessarily help readability... Some of the callbacks passed as parameters can be possibly pushed down the callstack, the only difference is btree_inode vs file extents. Instead of the uppper caller switch, the right function can be called based on the inode number (btree_inode has 1). Josef has some ideas/patches to get rid of the btree_inode completely so cleaning up the callback might not be worth. There's still some potential to reduce the arguments to the various callbacks, I have patches for that. This is a relatively easy and safe so I would still send them, as the btree_inode removal will be probably intrusive and the ETA for such changes is unpredictable. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
