From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>
Cc: Kanchan Joshi <joshi.k@samsung.com>, linux-nvme@lists.infradead.org
Subject: [PATCH 1/3] nvme: remove __nvme_ioctl
Date: Sun, 8 Jan 2023 17:50:31 +0100 [thread overview]
Message-ID: <20230108165033.380842-2-hch@lst.de> (raw)
In-Reply-To: <20230108165033.380842-1-hch@lst.de>
Open code __nvme_ioctl in the two callers to make future changes that
pass down additional paramters in the ioctl path easier.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/host/ioctl.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index a8639919237e6a..c12b7c445fc0b2 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -695,28 +695,26 @@ static int nvme_ns_ioctl(struct nvme_ns *ns, unsigned int cmd,
}
}
-static int __nvme_ioctl(struct nvme_ns *ns, unsigned int cmd, void __user *arg,
- fmode_t mode)
-{
- if (is_ctrl_ioctl(cmd))
- return nvme_ctrl_ioctl(ns->ctrl, cmd, arg, mode);
- return nvme_ns_ioctl(ns, cmd, arg, mode);
-}
-
int nvme_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
struct nvme_ns *ns = bdev->bd_disk->private_data;
+ void __user *argp = (void __user *)arg;
- return __nvme_ioctl(ns, cmd, (void __user *)arg, mode);
+ if (is_ctrl_ioctl(cmd))
+ return nvme_ctrl_ioctl(ns->ctrl, cmd, argp, mode);
+ return nvme_ns_ioctl(ns, cmd, argp, mode);
}
long nvme_ns_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct nvme_ns *ns =
container_of(file_inode(file)->i_cdev, struct nvme_ns, cdev);
+ void __user *argp = (void __user *)arg;
- return __nvme_ioctl(ns, cmd, (void __user *)arg, file->f_mode);
+ if (is_ctrl_ioctl(cmd))
+ return nvme_ctrl_ioctl(ns->ctrl, cmd, argp, file->f_mode);
+ return nvme_ns_ioctl(ns, cmd, argp, file->f_mode);
}
static int nvme_uring_cmd_checks(unsigned int issue_flags)
--
2.35.1
next prev parent reply other threads:[~2023-01-08 16:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230108165424epcas5p2b6d079dfcc8b1a91692f19729cc45b9a@epcas5p2.samsung.com>
2023-01-08 16:50 ` don't allow unprivileged passthrough on partitions Christoph Hellwig
2023-01-08 16:50 ` Christoph Hellwig [this message]
2023-01-09 7:34 ` [PATCH 1/3] nvme: remove __nvme_ioctl Chaitanya Kulkarni
2023-01-12 13:20 ` Hannes Reinecke
2023-01-08 16:50 ` [PATCH 2/3] nvme: replace the "bool vec" arguments with flags in the ioctl path Christoph Hellwig
2023-01-09 7:39 ` Chaitanya Kulkarni
2023-01-12 13:21 ` Hannes Reinecke
2023-01-08 16:50 ` [PATCH 3/3] nvme: don't allow unprivileged passthrough on partitions Christoph Hellwig
2023-01-09 7:40 ` Chaitanya Kulkarni
2023-01-12 13:23 ` Hannes Reinecke
2023-01-12 14:03 ` Christoph Hellwig
2023-01-09 10:45 ` Kanchan Joshi
2023-01-09 15:13 ` Keith Busch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230108165033.380842-2-hch@lst.de \
--to=hch@lst.de \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.