diff options
author | Keith Busch <keith.busch@intel.com> | 2012-07-25 18:07:55 -0400 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2012-07-26 12:24:36 -0400 |
commit | 50af8baec46a99a9b81a4600c0374f83a5a590a9 (patch) | |
tree | d8bb38296faa6732c1dac9cbd64a1db43ab91f97 | |
parent | 5c42ea1643a630060f9e71e06d3933d244970967 (diff) |
NVMe: replace nvme_ns with nvme_dev for user admin
The function nvme_user_admin_command does not require a namespace to
proceed. Replace with the nvme_dev structure so that it can be called
from contexts that do not have a namespace.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
-rw-r--r-- | drivers/block/nvme.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index 46e33eec6298..89935853cb85 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -1151,10 +1151,9 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio) | |||
1151 | return status; | 1151 | return status; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | static int nvme_user_admin_cmd(struct nvme_ns *ns, | 1154 | static int nvme_user_admin_cmd(struct nvme_dev *dev, |
1155 | struct nvme_admin_cmd __user *ucmd) | 1155 | struct nvme_admin_cmd __user *ucmd) |
1156 | { | 1156 | { |
1157 | struct nvme_dev *dev = ns->dev; | ||
1158 | struct nvme_admin_cmd cmd; | 1157 | struct nvme_admin_cmd cmd; |
1159 | struct nvme_command c; | 1158 | struct nvme_command c; |
1160 | int status, length; | 1159 | int status, length; |
@@ -1209,7 +1208,7 @@ static int nvme_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
1209 | case NVME_IOCTL_ID: | 1208 | case NVME_IOCTL_ID: |
1210 | return ns->ns_id; | 1209 | return ns->ns_id; |
1211 | case NVME_IOCTL_ADMIN_CMD: | 1210 | case NVME_IOCTL_ADMIN_CMD: |
1212 | return nvme_user_admin_cmd(ns, (void __user *)arg); | 1211 | return nvme_user_admin_cmd(ns->dev, (void __user *)arg); |
1213 | case NVME_IOCTL_SUBMIT_IO: | 1212 | case NVME_IOCTL_SUBMIT_IO: |
1214 | return nvme_submit_io(ns, (void __user *)arg); | 1213 | return nvme_submit_io(ns, (void __user *)arg); |
1215 | default: | 1214 | default: |