linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to implement this logic?
@ 2007-12-15  0:31 a_kumar
  0 siblings, 0 replies; only message in thread
From: a_kumar @ 2007-12-15  0:31 UTC (permalink / raw)
  To: linux-kernel


Hi, 

I've a block device driver which does the following,

Inside the request function I do something like this:
request(fn) {

 while ((req = elv_next_request(q)) != NULL) {
....................set up the request;
 spin_unlock_irq(q->queue_lock);
call the transfer(set_up_req) function;
spin_lock_irq(q->queue_lock);
}
       spin_unlock_irq (q->queue_lock);
        /* allow callback to execute as it needs the lock!!! */
        spin_lock_irq (q->queue_lock);


}
and the transfer function calls the scsi_execute_asyn(....) with the
callback function doing the end request. So, the ending of the request is
done like below:

callback(fn) {

 spin_lock_irqsave(q->queue_lock, flags);
        if (!end_that_request_first(set_up_req->req, cmpstatus,
                        set_up_req->req->nr_sectors)) {
                add_disk_randomness(...);
                end_that_request_last(set_up_req->req,0);
        }
        spin_unlock_irqrestore(q->queue_lock, flags);
}


This code works fine with most of the kernel versions, but fails on some
like , Linux 2.6.18-8.el5-xen

Please help me to find out where I'm going wrong?

Thanks in advance for an early reply.
Anil P.
-- 
View this message in context: http://www.nabble.com/how-to-implement-this-logic--tp14339868p14339868.html
Sent from the linux-kernel mailing list archive at Nabble.com.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-15  0:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-15  0:31 how to implement this logic? a_kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).