On Fri, Dec 19, 2025 at 12:25:33PM -0800, Eric Biggers wrote: > > Also, this shows that the decrement of 'nr_segs' is a bit out-of-place > (as was 'enc_idx'). nr_segs is used only when allocating a bio, so it > could be decremented only when starting a new one: > > submit_bio(enc_bio); > nr_segs -= nr_enc_pages; > goto new_bio;
I've just killed nr_segs entirely. While bio_segments() is a bit expensive, it is totally shadowed by encrypting an entire bio. This simplifies things quite a bit.
