Re: end_request() deprecated, which one should be used ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 02 2008, Thomas Petazzoni wrote:
> Hi Jens,
> 
> Le Tue, 2 Sep 2008 08:46:49 +0200,
> Jens Axboe <jens.axboe@xxxxxxxxxx> a écrit :
> 
> > 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.
> 
> Thanks for this answer. However, it raises a few more questions:
> 
>  * end_queued_request() and end_dequeued_request() have exactly the
>    same code, so what's the point of having two separate functions ?

They do act in the same way now, but that is because
end_that_request_last() automatically detects whether a request needs to
be dequeued or not.

>  * You say that end_*_request() are used to completely end a request, I
>    suppose it's because they call __end_request() with
>    rq->hard_nr_sectors << 9 (in the case of normal fs requests). But
>    end_request() also does this, and my understanding is that a driver
>    like drivers/block/z2ram.c only handles one segment per iteration
>    (req->current_nr_sectors sectors) of the loop in do_z2_request(). But
>    it uses end_request() at each iteration... which shouldn't completely
>    end the request, but simply move to the next segment (changing
>    rq->buffer, rq->sector, etc.). How does it work ?

end_request() uses hard_cur_sectors, so it does indeed only act on the
current segment of the request. end_*_request() act on the full request,
hard_nr_sectors.

-- 
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



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux