diff mbox

Re: [PATCH 20/25] io-controller: map async requests to appropriate cgroup

Message ID 4A7647DA.5050607@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gui Jianfeng Aug. 3, 2009, 2:13 a.m. UTC
Vivek Goyal wrote:
...
> +
> +struct io_group *io_get_io_group_bio(struct request_queue *q, struct bio *bio,
> +					int create)
> +{
> +	struct page *page = NULL;
> +
> +	/*
> +	 * Determine the group from task context. Even calls from
> +	 * blk_get_request() which don't have any bio info will be mapped
> +	 * to the task's group
> +	 */
> +	if (!bio)
> +		goto sync;
> +
> +	if (bio_barrier(bio)) {
> +		/*
> +		 * Map barrier requests to root group. May be more special
> +		 * bio cases should come here
> +		 */
> +		return q->elevator->efqd.root_group;
> +	}
> +
> +	/* Map the sync bio to the right group using task context */
> +	if (elv_bio_sync(bio))
> +		goto sync;
> +
> +#ifdef CONFIG_TRACK_ASYNC_CONTEXT
> +	/* Determine the group from info stored in page */
> +	page = bio_iovec_idx(bio, 0)->bv_page;
> +	return io_get_io_group(q, page, create);
> +#endif
> +
> +sync:
> +	return io_get_io_group(q, NULL, create);

Fix build warning.

block/elevator-fq.c: In function ‘io_get_io_group_bio’:
block/elevator-fq.c:2075: warning: unused variable ‘page’

---

> +}
> +EXPORT_SYMBOL(io_get_io_group_bio);
> +

Comments

Vivek Goyal Aug. 4, 2009, 1:25 a.m. UTC | #1
On Mon, Aug 03, 2009 at 10:13:46AM +0800, Gui Jianfeng wrote:
> Vivek Goyal wrote:
> ...
> > +
> > +struct io_group *io_get_io_group_bio(struct request_queue *q, struct bio *bio,
> > +					int create)
> > +{
> > +	struct page *page = NULL;
> > +
> > +	/*
> > +	 * Determine the group from task context. Even calls from
> > +	 * blk_get_request() which don't have any bio info will be mapped
> > +	 * to the task's group
> > +	 */
> > +	if (!bio)
> > +		goto sync;
> > +
> > +	if (bio_barrier(bio)) {
> > +		/*
> > +		 * Map barrier requests to root group. May be more special
> > +		 * bio cases should come here
> > +		 */
> > +		return q->elevator->efqd.root_group;
> > +	}
> > +
> > +	/* Map the sync bio to the right group using task context */
> > +	if (elv_bio_sync(bio))
> > +		goto sync;
> > +
> > +#ifdef CONFIG_TRACK_ASYNC_CONTEXT
> > +	/* Determine the group from info stored in page */
> > +	page = bio_iovec_idx(bio, 0)->bv_page;
> > +	return io_get_io_group(q, page, create);
> > +#endif
> > +
> > +sync:
> > +	return io_get_io_group(q, NULL, create);
> 
> Fix build warning.
> 
> block/elevator-fq.c: In function ‘io_get_io_group_bio’:
> block/elevator-fq.c:2075: warning: unused variable ‘page’
> 

Thanks Gui. Will apply in next posting.

Vivek

> ---
> diff --git a/block/elevator-fq.c b/block/elevator-fq.c
> index 66b10eb..d304f79 100644
> --- a/block/elevator-fq.c
> +++ b/block/elevator-fq.c
> @@ -2102,7 +2102,7 @@ struct io_group *io_get_io_group_bio(struct request_queue *q, struct bio *bio,
>  #endif
>  
>  sync:
> -	return io_get_io_group(q, NULL, create);
> +	return io_get_io_group(q, page, create);
>  }
>  EXPORT_SYMBOL(io_get_io_group_bio);
> 
> 
> > +}
> > +EXPORT_SYMBOL(io_get_io_group_bio);
> > +
> 
> 
> -- 
> Regards
> Gui Jianfeng

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/block/elevator-fq.c b/block/elevator-fq.c
index 66b10eb..d304f79 100644
--- a/block/elevator-fq.c
+++ b/block/elevator-fq.c
@@ -2102,7 +2102,7 @@  struct io_group *io_get_io_group_bio(struct request_queue *q, struct bio *bio,
 #endif
 
 sync:
-	return io_get_io_group(q, NULL, create);
+	return io_get_io_group(q, page, create);
 }
 EXPORT_SYMBOL(io_get_io_group_bio);