On Wed, Mar 23, 2022 at 09:39:24AM +0800, Qu Wenruo wrote: > Not familar with iomap thus I can be totally wrong, but isn't the idea > of iomap to separate more code from fs? Well, to share more code, which requires a certain abstraction, yes. > I'm really not sure if it's a good idea to expose btrfs internal bio_set > just for iomap. We don't. iomap still purely operates on the generic bio. It just allocates additional space for btrfs to use after ->submit_io is called. Just like how e.g. VFS inodes can come with extra space for file system use. > Personally speaking I didn't see much problem of cloning an iomap bio, > it only causes extra memory of btrfs_bio, which is pretty small previously. It is yet another pointless memory allocation in something considered very much a fast path.