Re: [PATCH v3 6/7] block: unpin all pages of a bvec in bio_iov_iter_align_down()
From: Christoph Hellwig
Date: Fri Sep 18 2026 - 04:43:39 EST
> +
> + /*
> + * __bio_release_pages() only unpins the pages still covered by
> + * bv_len, so drop the pins for the pages trimmed off here.
> + */
> + npages = bvec_nr_pages(bv);
> bv->bv_len -= nbytes;
> + npages -= bvec_nr_pages(bv);
Wouldn't it make more sense to calculate npages once after the
decrement here, or am I missing something?