LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: oakad@exemail.com.au, linux-kernel@vger.kernel.org,
	Alex Dubov <oakad@yahoo.com>
Subject: Re: [PATCH] [MEMSTICK] Initial commit for Sony MemoryStick support
Date: Fri, 11 Jan 2008 13:14:21 +0100	[thread overview]
Message-ID: <20080111121420.GS6258@kernel.dk> (raw)
In-Reply-To: <20080110010049.695da076.akpm@linux-foundation.org>

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


  reply	other threads:[~2008-01-11 12:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02  6:42 oakad
2008-01-10  9:00 ` Andrew Morton
2008-01-11 12:14   ` Jens Axboe [this message]
2008-01-14  3:26   ` Alex Dubov
2008-01-22 16:12   ` Alex Dubov
2008-01-22 18:59     ` Andrew Morton
2008-01-25  7:58       ` [PATCH] [MEMSTICK] Updates for the memstick driver Alex Dubov
2008-01-27  6:01         ` Andrew Morton
2008-02-03  0:16         ` Andrew Morton
2008-02-04  4:31           ` [PATCH] memstick: use __blk_end_request to complete requests Alex Dubov
2008-02-04  7:07             ` Andrew Morton
2008-02-09 14:59               ` [PATCH] memstick: fix attribute structure casting in mspro_block_resume Alex Dubov
2008-01-15 17:21 ` [PATCH] [MEMSTICK] Initial commit for Sony MemoryStick support Mariusz Kozlowski
2008-01-16  1:52   ` Alex Dubov
  -- strict thread matches above, loose matches on Subject: below --
2008-01-13 22:47 Miguel Botón
2007-12-24  3:06 oakad
2007-12-31  0:01 ` Carlos Corbacho
2007-12-31  0:31   ` Jan Engelhardt
2007-12-31  0:54     ` Alex Dubov
2007-12-31  0:56     ` Carlos Corbacho
2007-12-31  1:01   ` Alex Dubov
2007-12-31  1:15     ` Carlos Corbacho
2007-12-31  4:51       ` Alex Dubov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080111121420.GS6258@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakad@exemail.com.au \
    --cc=oakad@yahoo.com \
    --subject='Re: [PATCH] [MEMSTICK] Initial commit for Sony MemoryStick support' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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