On 12/1/20 5:06 AM, Ming Lei wrote: > Pavel reported that iov_iter_npages is a bit heavy in case of bvec > iter. > > Turns out it isn't necessary to iterate every page in the bvec iter, > and we call iov_iter_npages() just for figuring out how many bio > vecs need to be allocated. And we can simply map each vector in bvec iter > to bio's vec, so just return iter->nr_segs from bio_iov_iter_nvecs() for > bvec iter. > > Also rename local variable 'nr_pages' as 'nr_vecs' which exactly matches its > real usage. I'd really prefer to keep the renaming separate from the actual change. -- Jens Axboe