lkml.org 
[lkml]   [2002]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: One more bio for for floppy users in 2.5.33..

Btw, the update to do partial completion will need a few more fixes: right
now the different callers of "bio->bi_end_io(bio)" are not very careful
about updating the bio information, since no bi_end_io() function has had
any reason to care before.

That turns the 2-liner patch into slightly more, since for example the
failure cases in __make_request() need to make sure that they pass in the
right size/sector count. So the

....
end_io:
bio->bi_end_io(bio);
return 0;

would become something like

....
end_io:
bio->bi_size = 0;
bio->bi_end_io(bio, nr_sectors);
return 0;

if we had this interface.

To avoid those kinds of silly bugs and to avoid havind the bi_end_io()
function have to look up all the bio information, maybe the end_io calling
convention really should be

void bio_end_io(struct bio *bio,
unsigned int completed,
unsigned int left,
unsigned int uptodate);

and then a failure would just be

bio->bi_end_io(bio, nr_sectors, 0, 0);

and the end-io function would have all the information it needs to decide
how much has been done / is left undone directly in the arguments.

One final question would be whether we would want to make all of these
byte counts, for some future networked block device where we might be
getting the completions back in odd-sized chunks, for example? Right now
much of the bio code already is able to handle byte-sized stuff, and it
might be nice to not have to maintain byte counts in NBD if the bio layer
already does it anyway..

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.143 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site