On 5/18/22 19:11, Keith Busch wrote:
+ for (left = size, i = 0; left > 0; left -= len, i++) { + struct page *page = pages[i]; + bool same_page = false; + + len = min_t(size_t, PAGE_SIZE - offset, left); + if (bio_add_hw_page(q, bio, page, len, offset, + max_append_sectors, &same_page) != len) { + bio_put_pages(pages + i, left, offset); + ret = -EINVAL; + break; + } + if (same_page) + put_page(page); + offset = 0; + }
Consider renaming 'same_page' into 'merged'. I think that name reflects much better the purpose of that variable.
Thanks, Bart.