Messages in this thread | | | Date | Wed, 19 Oct 2011 09:31:58 -0700 | From | Tejun Heo <> | Subject | Re: [PATCH 04/10] block: pass around REQ_* flags instead of broken down booleans during request alloc/free |
| |
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
| |