mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
scsi: cxlflash: Cache owning adapter within context
The context removal routine requires access to the owning adapter structure to reset the context within the AFU as part of the tear down sequence. In order to support kref adoption, the owning adapter must be accessible from the release handler. As the kref framework only provides the kref reference as the sole parameter, another means is needed to derive the owning adapter. As a remedy, the owning adapter reference is saved off within the context during initialization. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Acked-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
41b99e1a30
commit
44ef38f9a2
2 changed files with 2 additions and 0 deletions
|
@ -804,6 +804,7 @@ static void init_context(struct ctx_info *ctxi, struct cxlflash_cfg *cfg,
|
||||||
ctxi->lfd = adap_fd;
|
ctxi->lfd = adap_fd;
|
||||||
ctxi->pid = current->tgid; /* tgid = pid */
|
ctxi->pid = current->tgid; /* tgid = pid */
|
||||||
ctxi->ctx = ctx;
|
ctxi->ctx = ctx;
|
||||||
|
ctxi->cfg = cfg;
|
||||||
ctxi->file = file;
|
ctxi->file = file;
|
||||||
ctxi->initialized = true;
|
ctxi->initialized = true;
|
||||||
mutex_init(&ctxi->mutex);
|
mutex_init(&ctxi->mutex);
|
||||||
|
|
|
@ -107,6 +107,7 @@ struct ctx_info {
|
||||||
bool err_recovery_active;
|
bool err_recovery_active;
|
||||||
struct mutex mutex; /* Context protection */
|
struct mutex mutex; /* Context protection */
|
||||||
struct cxl_context *ctx;
|
struct cxl_context *ctx;
|
||||||
|
struct cxlflash_cfg *cfg;
|
||||||
struct list_head luns; /* LUNs attached to this context */
|
struct list_head luns; /* LUNs attached to this context */
|
||||||
const struct vm_operations_struct *cxl_mmap_vmops;
|
const struct vm_operations_struct *cxl_mmap_vmops;
|
||||||
struct file *file;
|
struct file *file;
|
||||||
|
|
Loading…
Reference in a new issue