lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/12] elevator: make elevator_init_fn() return 0/-errno
Hello,

On Thu, Jan 19, 2012 at 06:11:51AM -0500, Vivek Goyal wrote:
> On Wed, Jan 18, 2012 at 05:11:22PM -0800, Tejun Heo wrote:
> > elevator_ops->elevator_init_fn() has a weird return value. It returns
> > a void * which the caller should assign to q->elevator->elevator_data
> > and %NULL return denotes init failure.
> >
> > Update such that it returns integer 0/-errno and sets elevator_data
> > directly as necessary.
>
> kmalloc() does the same thing. returning pointer means success and null
> means failure.

Yes, allocation functions usually do that. elevator_init_fn() isn't
exactly one. It could be but not necessarily so. Look at the
elevator init wrapper in elevator.c. We shouldn't need something like
that.

> Also elevator initialization might not necessarily mean that you are
> the active elevator. So cfq_init_queue() assuming that I am the active
> elevator and setting up q->elevator->elevator_data sounds odd to me.

That was changed by the elvator switch sequence update earlier in this
series.

We need this change to use common blkg code for root blkg init.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-01-19 16:47    [W:0.073 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site