Thread (4 messages) 4 messages, 2 authors, 2021-04-28

Re: bio_add_folio argument order

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-04-28 16:58:48

On 4/28/21 10:50 AM, Matthew Wilcox wrote:
bio_add_page() has its arguments in the wrong order:

extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);

Oh, right, and the prototype commits the cardinal sin of just giving you
a pair of unsigned ints and doesn't bother to tell you what they mean.
I'll send a patch for that ... anyway:

int bio_add_page(struct bio *bio, struct page *page,
                 unsigned int len, unsigned int offset)

This fails to follow #4: https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html

Here's what I want to do for the folio equivalent:

size_t bio_add_folio(struct bio *bio, struct folio *folio, size_t off,
                size_t len)

This will make the transition more painful, but it does remove an irritant
for the future.  Any objections?
What's the point in shuffling len and offset around?

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help