lkml.org 
[lkml]   [2008]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [MEMSTICK] Initial commit for Sony MemoryStick support
On Thu, Jan 10 2008, Andrew Morton wrote:
> > +static void mspro_block_request(struct request_queue *q)
> > +{
> > + struct memstick_dev *card = q->queuedata;
> > + struct mspro_block_data *msb = memstick_get_drvdata(card);
> > + struct request *req = NULL;
> > +
> > + if (!msb->q_thread) {
> > + for (req = elv_next_request(q); req;
> > + req = elv_next_request(q)) {
> > + while (end_that_request_chunk(req, -ENODEV,
> > + req->current_nr_sectors
> > + << 9)) {}
> > + end_that_request_last(req, -ENODEV);
> > + }
> > + } else {
> > + msb->has_request = 1;
> > + wake_up_all(&msb->q_wait);
> > + }
> > +}
>
> Suggest that you cc Jens on this, see if he can check it all over.

It's suboptimal and doesn't work for non-fs request. Just use
end_queued_request() instead:

if (msb->q_thread) {
msb->has_request = 1;
wake_up(&msb->q_wait);
} else {
while ((req = elv_next_request(q)) != NULL)
end_queued_request(req, -ENODEV);
}

which is simpler and gets all cases correct. Reordering for normal case
as well.

--
Jens Axboe



\
 
 \ /
  Last update: 2008-01-11 13:17    [W:1.001 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site