[PATCH 3/7] cxlflash: Split out context initialization

Uma Krishnan ukrishn at linux.vnet.ibm.com
Wed Mar 9 04:55:23 AEDT 2016


On 3/4/2016 3:55 PM, Uma Krishnan wrote:
> From: "Matthew R. Ochs" <mrochs at linux.vnet.ibm.com>
>
> Presently, context information structures are allocated and
> initialized in the same routine, create_context(). This imposes
> an ordering restriction such that all pieces of information needed
> to initialize a context must be known before the context is even
> allocated.
>
> This design point is not flexible when the order of context
> creation needs to be modified. Specifically, this can lead to
> problems when members of the context information structure are
> a part of an ordering dependency (i.e. - the 'work' structure
> embedded within the context).
>
> To remedy, the allocation is left as-is, inside of the existing
> create_context() routine and the initialization is transitioned
> to a new void routine, init_context(). At the same time, in
> anticipation of these routines not being called in sequence, a
> state boolean is added to the context information structure to
> track when the context has been initilized. The context teardown
> routine, destroy_context(), is modified to support being called
> with a non-initialized context.
>
> Signed-off-by: Matthew R. Ochs <mrochs at linux.vnet.ibm.com>

Reviewed-by: Uma Krishnan <ukrishn at linux.vnet.ibm.com>



More information about the Linuxppc-dev mailing list