Skip to content

Commit 2fa1dc8

Browse files
author
Christoph Hellwig
committed
nvme: remove __nvme_ioctl
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> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
1 parent 09113ab commit 2fa1dc8

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

drivers/nvme/host/ioctl.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -695,28 +695,26 @@ static int nvme_ns_ioctl(struct nvme_ns *ns, unsigned int cmd,
695695
}
696696
}
697697

698-
static int __nvme_ioctl(struct nvme_ns *ns, unsigned int cmd, void __user *arg,
699-
fmode_t mode)
700-
{
701-
if (is_ctrl_ioctl(cmd))
702-
return nvme_ctrl_ioctl(ns->ctrl, cmd, arg, mode);
703-
return nvme_ns_ioctl(ns, cmd, arg, mode);
704-
}
705-
706698
int nvme_ioctl(struct block_device *bdev, fmode_t mode,
707699
unsigned int cmd, unsigned long arg)
708700
{
709701
struct nvme_ns *ns = bdev->bd_disk->private_data;
702+
void __user *argp = (void __user *)arg;
710703

711-
return __nvme_ioctl(ns, cmd, (void __user *)arg, mode);
704+
if (is_ctrl_ioctl(cmd))
705+
return nvme_ctrl_ioctl(ns->ctrl, cmd, argp, mode);
706+
return nvme_ns_ioctl(ns, cmd, argp, mode);
712707
}
713708

714709
long nvme_ns_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
715710
{
716711
struct nvme_ns *ns =
717712
container_of(file_inode(file)->i_cdev, struct nvme_ns, cdev);
713+
void __user *argp = (void __user *)arg;
718714

719-
return __nvme_ioctl(ns, cmd, (void __user *)arg, file->f_mode);
715+
if (is_ctrl_ioctl(cmd))
716+
return nvme_ctrl_ioctl(ns->ctrl, cmd, argp, file->f_mode);
717+
return nvme_ns_ioctl(ns, cmd, argp, file->f_mode);
720718
}
721719

722720
static int nvme_uring_cmd_checks(unsigned int issue_flags)

0 commit comments

Comments
 (0)