public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, jeremy@xensource.com
Subject: Re: [PATCH] Release old elevator on change elevator
Date: Fri, 14 Nov 2008 09:40:45 +0100	[thread overview]
Message-ID: <20081114084045.GO26778@kernel.dk> (raw)
In-Reply-To: <491D387D.1000501@cn.fujitsu.com>

On Fri, Nov 14 2008, Zhaolei wrote:
> We should release old elevator when change to use a new one.
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> ---
>  drivers/block/xen-blkfront.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index b220c68..2d19f0c 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -338,12 +338,18 @@ wait:
>  static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size)
>  {
>  	struct request_queue *rq;
> +	elevator_t *old_e;
>  
>  	rq = blk_init_queue(do_blkif_request, &blkif_io_lock);
>  	if (rq == NULL)
>  		return -1;
>  
> -	elevator_init(rq, "noop");
> +	old_e = rq->elevator;
> +	if (IS_ERR_VALUE(elevator_init(rq, "noop")))
> +		printk(KERN_WARNING
> +			"blkfront: Switch elevator failed, use default\n");
> +	else
> +		elevator_exit(old_e);
>  
>  	/* Hard sector size and max sectors impersonate the equiv. hardware. */
>  	blk_queue_hardsect_size(rq, sector_size);
> -- 
> 1.5.5.3

I thought we'd already switched that to the nonrot flag, but that is
merged up for 2.6.29. So this looks appropriate for 2.6.28, I'll queue
it up.

-- 
Jens Axboe


      reply	other threads:[~2008-11-14  8:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14  8:36 [PATCH] Release old elevator on change elevator Zhaolei
2008-11-14  8:40 ` Jens Axboe [this message]

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=20081114084045.GO26778@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=jeremy@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhaolei@cn.fujitsu.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox