[PATCH 1/3] nvme: decouple nvme_ctrl_get_by_path()
Chaitanya Kulkarni
Chaitanya.Kulkarni at wdc.com
Sat Sep 5 18:57:42 EDT 2020
On 9/5/20 00:20, Christoph Hellwig wrote:
>> I still don't really like this idea. No need to keep a reference to a
>> whole other file.
File reference open/close is coupled with ctrl refcnt and module refcnt.
What is a problem with keeping the file reference open ?
> We could still lift the filp_open into the caller, but drop the file
> reference right after we got the controller reference.
>
The file open call gets the ctrl and module reference atomically and on
close release the module and ctrl reference respectively.
If dropping the file reference means closing the file then it will lead
to loosing the module and ctrl reference.
That also means, moving the references get/put out of
nvme_dev_open()/nvme_dev_release() in host-core, it will fix the problem
only for the passthru case. Having done it in the core takes care of the
all the cases if any.
More information about the Linux-nvme
mailing list