[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Oct 2019 13:37:54 +0200
From: Christoph Hellwig <hch@....de>
To: Logan Gunthorpe <logang@...tatee.com>
Cc: linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...com>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>,
Max Gurtovoy <maxg@...lanox.com>,
Stephen Bates <sbates@...thlin.com>
Subject: Re: [PATCH v9 01/12] nvme-core: introduce nvme_ctrl_get_by_path()
> +struct nvme_ctrl *nvme_ctrl_get_by_path(const char *path)
> +{
> + struct nvme_ctrl *ctrl;
> + struct file *f;
> +
> + f = filp_open(path, O_RDWR, 0);
> + if (IS_ERR(f))
> + return ERR_CAST(f);
> +
> + if (f->f_op != &nvme_dev_fops) {
> + ctrl = ERR_PTR(-EINVAL);
> + goto out_close;
> + }
> +
> + ctrl = f->private_data;
> + nvme_get_ctrl(ctrl);
> +
> +out_close:
> + filp_close(f, NULL);
> +
> + return ctrl;
No need for the empty line here. Also can you make sure this new
code (and all the new exports) are only enabled if
CONFIG_NVME_TARGET_PASSTHRU is set. Preferably by having a little
block at the end of this file with this function and the extra
exports with a big fat comment that they are only for nvmet-passthrough.
Powered by blists - more mailing lists