[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: end_request() deprecated, which one should be used ?
On Mon, Sep 01 2008, Thomas Petazzoni wrote:
> Hi,
>
> The comment at the top of end_request() says:
>
> * This is a remnant of how older block drivers handled IO completions.
> * Modern drivers typically end IO on the full request in one go, unless
> * they have a residual value to account for. For that case this function
> * isn't really useful, unless the residual just happens to be the
> * full current segment. In other words, don't use this function in new
> * code. Either use end_request_completely(), or the
> * end_that_request_chunk() (along with end_that_request_last()) for
> * partial completions.
>
> But unless I'm blind, neither end_request_completely() nor
> end_request_chunk() exist.
>
> There are several request completion notification functions
> (end_request, end_queued_request, end_dequeued_request, blk_end_request
> and __blk_end_request). Which ones should be used in what case ?
>
> If end_request() is deprecated, I suspect that the goal is to deprecate
> all end_*_request() functions as well, is it correct ? If so, is that
> correct that one should use blk_end_request() when the queue lock is
> not held, and __blk_end_request() if the queue lock is already held ?
end_request() is deprecated, and only that one. You can use
end_dequeued_request() or end_queued_request() to completely end a
dequeued or queued request. Or you can use blk_end_request() to end
nr_bytes of IO on that request. Those are the functions that you should
use. And yes, you should use __blk_end_request() if you already have the
queue lock grabbed.
--
Jens Axboe
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ