diff options
author | Matthew R. Ochs <mrochs@linux.vnet.ibm.com> | 2016-03-05 00:55:16 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-03-09 05:17:33 +0300 |
commit | 5e6632d19ea2fafaec1b7c4cda7f7157ee8ad983 (patch) | |
tree | 083307c2211a29108de926d9d06722fdcb096d35 /drivers/scsi/cxlflash/superpipe.h | |
parent | 6ded8b3cbd9a6254da5a38f35e20aa3c316d9092 (diff) | |
download | linux-5e6632d19ea2fafaec1b7c4cda7f7157ee8ad983.tar.xz |
cxlflash: Split out context initialization
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@linux.vnet.ibm.com>
Reviewed-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/superpipe.h')
-rw-r--r-- | drivers/scsi/cxlflash/superpipe.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/superpipe.h b/drivers/scsi/cxlflash/superpipe.h index bede574bcd77..5f9a091fda95 100644 --- a/drivers/scsi/cxlflash/superpipe.h +++ b/drivers/scsi/cxlflash/superpipe.h @@ -102,6 +102,7 @@ struct ctx_info { u64 ctxid; int lfd; pid_t pid; + bool initialized; bool unavail; bool err_recovery_active; struct mutex mutex; /* Context protection */ |