On Thu, Mar 09, 2023 at 08:08:34AM +0800, Qu Wenruo wrote: > My current one is a new btrfs_submit_scrub_read() helper, getting rid of > features I don't need and slightly modify the endio functions to avoid any > checks if no bbio->inode. AKA, most of your idea. > > So that would be mostly fine. This looks mostly ok to me. I suspect in the longer run all metadata I/O might be able to use this helper as well. > But for RAID56, the bioc has to live long enough for raid56 work to finish, > thus has to go btrfs_raid56_end_io() and rely on the extra bbio->end_io(). The bioc lifetimes for RAID56 are a bit odd and one of the things I'd love to eventually look into, but іt's not very high on the priority list right now.