Block device request merging - repeated requests.
Jens Axboe
axboe en suse.de
Lun Ene 31 15:37:40 CST 2000
On Mon, Jan 31 2000, David Woodhouse wrote:
> axboe en suse.de said:
> > Sure this should be CURRENT->current_nr_sectors.
>
> OK. That makes some sense. Thanks.
>
> So now I get, in the simplest case, two consecutive requests, each with
> CURRENT->nr_sectors == 4, CURRENT->current_nr_sectors == 2, and
> CURRENT->sectors == 0.
(CURRENT->sector, right?). What is "the simplest" case? (dd something).
> There appears to be no CURRENT->current_sector.
No, CURRENT->sector is always the "current" sector. When you call
end_request, end_that_request_first will adjust rq->sector for
you.
> What am I missing?
Probably an end_request somewhere. The logic goes something like this:
- receive request
- transfer CURRENT->current_nr_sectors in direction of CURRENT->cmd
to CURRENT->buffer from/to CURRENT->sector
- end_request
You never need to look at CURRENT->nr_sectors if you are not handling
clustered requests yourself, end_request handles that for you.
FWIW, I have verified request handling with a dummy driver I wrote.
It even handles merged requests with "holes", i.e. non-consequitive
buffer heads.
--
* Jens Axboe <axboe en suse.de>
* Linux CD-ROM Maintainer
* http://www.kernel.dk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda