Re: [PATCH 04/10] block: pass around REQ_* flags instead of brokendown booleans during request alloc/free

From: Tejun Heo
Date: Wed Oct 19 2011 - 12:32:07 EST


Hello,

On Wed, Oct 19, 2011 at 09:44:24AM -0400, Vivek Goyal wrote:
> > static struct request *
> > -blk_alloc_request(struct request_queue *q, int flags, int priv, gfp_t gfp_mask)
> > +blk_alloc_request(struct request_queue *q, unsigned int flags, gfp_t gfp_mask)
> > {
> > struct request *rq = mempool_alloc(q->rq.rq_pool, gfp_mask);
> >
> > @@ -586,12 +586,10 @@ blk_alloc_request(struct request_queue *q, int flags, int priv, gfp_t gfp_mask)
> >
> > rq->cmd_flags = flags | REQ_ALLOCED;
> >
> > - if (priv) {
> > - if (unlikely(elv_set_request(q, rq, gfp_mask))) {
> > - mempool_free(rq, q->rq.rq_pool);
> > - return NULL;
> > - }
> > - rq->cmd_flags |= REQ_ELVPRIV;
>
> Don't we need to set REQ_ELVPRIV in rq->cmd_flags in this new code?

The caller is now supposed to set REQ_ELVPRIV in @flags if it wants
elevator initialized, so the above "rq->cmd_flags = flags | REQ_ALLOCED"
should be enough.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/