Re: [PATCH 1/3] btrfs: rename btrfs_io_bio_alloc() to btrfs_bio_alloc_iovecs()
From: Nikolay Borisov <hidden>
Date: 2021-09-07 08:53:29
From: Nikolay Borisov <hidden>
Date: 2021-09-07 08:53:29
On 7.09.21 г. 10:42, Qu Wenruo wrote:
Function btrfs_io_bio_alloc() is pretty similar to btrfs_bio_alloc(), the only major difference is the number of iovecs, and whether bi_sector is initialized. Thus there is no need to add the extra "_io", which is only going to cause confusion. Rename it to btrfs_bio_alloc_iovecs() to be easier to read.
The only difference between those 2 function is the fact that the latter sets bio->bi_iter.bi_sector. So I'd say those should be turned into 1 function which takes the vecs as parameter as well as the bi_sector. I've checked all callers of io_bio_alloc and we always have the sector when allocating the bio. And this can simply be renamed to btrfs_bio_alloc and be done with it. <snip>