Re: [PATCH 2/2] block: add a bvec_phys helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

On Fri, Jul 5, 2024 at 1:22 PM Christoph Hellwig <hch@xxxxxx> wrote:
On Fri, Jul 05, 2024 at 10:50:31AM +0200, Geert Uytterhoeven wrote:
+               seg_size = get_max_segment_size(lim, bvec_phys(bv) + total_len);
                seg_size = min(seg_size, len);

                (*nsegs)++;
@@ -492,8 +491,7 @@ static unsigned blk_bvec_map_sg(struct request_queue *q,
        while (nbytes > 0) {
                unsigned offset = bvec->bv_offset + total;
                unsigned len = min(get_max_segment_size(&q->limits,
-                                  page_to_phys(bvec->bv_page) + offset),
-                                  nbytes);
+                                  bvec_phys(bvec) + total), nbytes);
                struct page *page = bvec->bv_page;

                /*

If you would have introduce bvec_phys() first, you could fold the above
two hunks into [PATCH 1/2].

Not sure what the advantage of that is, though?

It would avoid having to change these lines twice: once to the open-coded
bvec_phys() variant, and a second time to bvec_phys().

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux