blob: c81690b2a681b09b4d8c12a352f4563df78b7233 [file] [log] [blame]
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -04001// SPDX-License-Identifier: GPL-2.0
2/*
3 * NVMe Over Fabrics Target File I/O commands implementation.
4 * Copyright (c) 2017-2018 Western Digital Corporation or its
5 * affiliates.
6 */
7#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
8#include <linux/uio.h>
9#include <linux/falloc.h>
10#include <linux/file.h>
Maurizio Lombardif2a58ff2021-11-22 11:08:27 +010011#include <linux/fs.h>
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040012#include "nvmet.h"
13
14#define NVMET_MAX_MPOOL_BVEC 16
15#define NVMET_MIN_MPOOL_OBJ 16
16
Anthony Iliopoulose8cd1ff2020-04-19 16:48:50 -070017int nvmet_file_ns_revalidate(struct nvmet_ns *ns)
18{
19 struct kstat stat;
20 int ret;
21
22 ret = vfs_getattr(&ns->file->f_path, &stat, STATX_SIZE,
23 AT_STATX_FORCE_SYNC);
24 if (!ret)
25 ns->size = stat.size;
26 return ret;
27}
28
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040029void nvmet_file_ns_disable(struct nvmet_ns *ns)
30{
31 if (ns->file) {
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -040032 if (ns->buffered_io)
33 flush_workqueue(buffered_io_wq);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040034 mempool_destroy(ns->bvec_pool);
35 ns->bvec_pool = NULL;
36 kmem_cache_destroy(ns->bvec_cache);
37 ns->bvec_cache = NULL;
38 fput(ns->file);
39 ns->file = NULL;
40 }
41}
42
43int nvmet_file_ns_enable(struct nvmet_ns *ns)
44{
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -040045 int flags = O_RDWR | O_LARGEFILE;
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -040046 int ret;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040047
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -040048 if (!ns->buffered_io)
49 flags |= O_DIRECT;
50
51 ns->file = filp_open(ns->device_path, flags, 0);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040052 if (IS_ERR(ns->file)) {
Daniel Wagnere207bbf2021-05-12 16:50:05 +020053 ret = PTR_ERR(ns->file);
54 pr_err("failed to open file %s: (%d)\n",
55 ns->device_path, ret);
56 ns->file = NULL;
57 return ret;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040058 }
59
Anthony Iliopoulose8cd1ff2020-04-19 16:48:50 -070060 ret = nvmet_file_ns_revalidate(ns);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040061 if (ret)
62 goto err;
63
Sagi Grimberg525ec492019-04-24 11:43:23 -070064 /*
65 * i_blkbits can be greater than the universally accepted upper bound,
66 * so make sure we export a sane namespace lba_shift.
67 */
68 ns->blksize_shift = min_t(u8,
69 file_inode(ns->file)->i_blkbits, 12);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040070
71 ns->bvec_cache = kmem_cache_create("nvmet-bvec",
72 NVMET_MAX_MPOOL_BVEC * sizeof(struct bio_vec),
73 0, SLAB_HWCACHE_ALIGN, NULL);
Wei Yongjun1367bc82018-05-31 11:41:30 +000074 if (!ns->bvec_cache) {
75 ret = -ENOMEM;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040076 goto err;
Wei Yongjun1367bc82018-05-31 11:41:30 +000077 }
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040078
79 ns->bvec_pool = mempool_create(NVMET_MIN_MPOOL_OBJ, mempool_alloc_slab,
80 mempool_free_slab, ns->bvec_cache);
81
Wei Yongjun1367bc82018-05-31 11:41:30 +000082 if (!ns->bvec_pool) {
83 ret = -ENOMEM;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040084 goto err;
Wei Yongjun1367bc82018-05-31 11:41:30 +000085 }
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040086
87 return ret;
88err:
89 ns->size = 0;
90 ns->blksize_shift = 0;
91 nvmet_file_ns_disable(ns);
92 return ret;
93}
94
Ming Lei02db9952019-03-27 17:07:22 +080095static void nvmet_file_init_bvec(struct bio_vec *bv, struct scatterlist *sg)
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -040096{
Ming Lei02db9952019-03-27 17:07:22 +080097 bv->bv_page = sg_page(sg);
98 bv->bv_offset = sg->offset;
99 bv->bv_len = sg->length;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400100}
101
102static ssize_t nvmet_file_submit_bvec(struct nvmet_req *req, loff_t pos,
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500103 unsigned long nr_segs, size_t count, int ki_flags)
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400104{
105 struct kiocb *iocb = &req->f.iocb;
106 ssize_t (*call_iter)(struct kiocb *iocb, struct iov_iter *iter);
107 struct iov_iter iter;
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500108 int rw;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400109
110 if (req->cmd->rw.opcode == nvme_cmd_write) {
111 if (req->cmd->rw.control & cpu_to_le16(NVME_RW_FUA))
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500112 ki_flags |= IOCB_DSYNC;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400113 call_iter = req->ns->file->f_op->write_iter;
114 rw = WRITE;
115 } else {
116 call_iter = req->ns->file->f_op->read_iter;
117 rw = READ;
118 }
119
David Howellsaa563d72018-10-20 00:57:56 +0100120 iov_iter_bvec(&iter, rw, req->f.bvec, nr_segs, count);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400121
122 iocb->ki_pos = pos;
123 iocb->ki_filp = req->ns->file;
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -0400124 iocb->ki_flags = ki_flags | iocb_flags(req->ns->file);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400125
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500126 return call_iter(iocb, &iter);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400127}
128
129static void nvmet_file_io_done(struct kiocb *iocb, long ret, long ret2)
130{
131 struct nvmet_req *req = container_of(iocb, struct nvmet_req, f.iocb);
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800132 u16 status = NVME_SC_SUCCESS;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400133
134 if (req->f.bvec != req->inline_bvec) {
135 if (likely(req->f.mpool_alloc == false))
136 kfree(req->f.bvec);
137 else
138 mempool_free(req->f.bvec, req->ns->bvec_pool);
139 }
140
Christoph Hellwige9061c32019-10-23 10:35:44 -0600141 if (unlikely(ret != req->transfer_len))
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800142 status = errno_to_nvme_status(req, ret);
143 nvmet_req_complete(req, status);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400144}
145
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500146static bool nvmet_file_execute_io(struct nvmet_req *req, int ki_flags)
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400147{
Ming Lei02db9952019-03-27 17:07:22 +0800148 ssize_t nr_bvec = req->sg_cnt;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400149 unsigned long bv_cnt = 0;
150 bool is_sync = false;
151 size_t len = 0, total_len = 0;
152 ssize_t ret = 0;
153 loff_t pos;
Ming Lei02db9952019-03-27 17:07:22 +0800154 int i;
155 struct scatterlist *sg;
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500156
157 if (req->f.mpool_alloc && nr_bvec > NVMET_MAX_MPOOL_BVEC)
158 is_sync = true;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400159
Sagi Grimberg9c891c12018-07-11 16:13:04 +0300160 pos = le64_to_cpu(req->cmd->rw.slba) << req->ns->blksize_shift;
Christoph Hellwige9061c32019-10-23 10:35:44 -0600161 if (unlikely(pos + req->transfer_len > req->ns->size)) {
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800162 nvmet_req_complete(req, errno_to_nvme_status(req, -ENOSPC));
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500163 return true;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400164 }
165
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400166 memset(&req->f.iocb, 0, sizeof(struct kiocb));
Ming Lei02db9952019-03-27 17:07:22 +0800167 for_each_sg(req->sg, sg, req->sg_cnt, i) {
168 nvmet_file_init_bvec(&req->f.bvec[bv_cnt], sg);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400169 len += req->f.bvec[bv_cnt].bv_len;
170 total_len += req->f.bvec[bv_cnt].bv_len;
171 bv_cnt++;
172
173 WARN_ON_ONCE((nr_bvec - 1) < 0);
174
175 if (unlikely(is_sync) &&
176 (nr_bvec - 1 == 0 || bv_cnt == NVMET_MAX_MPOOL_BVEC)) {
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500177 ret = nvmet_file_submit_bvec(req, pos, bv_cnt, len, 0);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400178 if (ret < 0)
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500179 goto complete;
180
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400181 pos += len;
182 bv_cnt = 0;
183 len = 0;
184 }
185 nr_bvec--;
186 }
187
Christoph Hellwige9061c32019-10-23 10:35:44 -0600188 if (WARN_ON_ONCE(total_len != req->transfer_len)) {
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400189 ret = -EIO;
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500190 goto complete;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400191 }
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500192
193 if (unlikely(is_sync)) {
194 ret = total_len;
195 goto complete;
196 }
197
198 /*
199 * A NULL ki_complete ask for synchronous execution, which we want
200 * for the IOCB_NOWAIT case.
201 */
202 if (!(ki_flags & IOCB_NOWAIT))
203 req->f.iocb.ki_complete = nvmet_file_io_done;
204
205 ret = nvmet_file_submit_bvec(req, pos, bv_cnt, total_len, ki_flags);
206
207 switch (ret) {
208 case -EIOCBQUEUED:
209 return true;
210 case -EAGAIN:
211 if (WARN_ON_ONCE(!(ki_flags & IOCB_NOWAIT)))
212 goto complete;
213 return false;
214 case -EOPNOTSUPP:
215 /*
216 * For file systems returning error -EOPNOTSUPP, handle
217 * IOCB_NOWAIT error case separately and retry without
218 * IOCB_NOWAIT.
219 */
220 if ((ki_flags & IOCB_NOWAIT))
221 return false;
222 break;
223 }
224
225complete:
226 nvmet_file_io_done(&req->f.iocb, ret, 0);
227 return true;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400228}
229
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -0400230static void nvmet_file_buffered_io_work(struct work_struct *w)
231{
232 struct nvmet_req *req = container_of(w, struct nvmet_req, f.work);
233
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500234 nvmet_file_execute_io(req, 0);
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -0400235}
236
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500237static void nvmet_file_submit_buffered_io(struct nvmet_req *req)
Chaitanya Kulkarni55eb942e2018-06-20 00:01:41 -0400238{
239 INIT_WORK(&req->f.work, nvmet_file_buffered_io_work);
240 queue_work(buffered_io_wq, &req->f.work);
241}
242
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500243static void nvmet_file_execute_rw(struct nvmet_req *req)
244{
Ming Lei02db9952019-03-27 17:07:22 +0800245 ssize_t nr_bvec = req->sg_cnt;
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500246
Israel Rukshin136cc1f2020-05-19 17:05:59 +0300247 if (!nvmet_check_transfer_len(req, nvmet_rw_data_len(req)))
Christoph Hellwige9061c32019-10-23 10:35:44 -0600248 return;
249
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500250 if (!req->sg_cnt || !nr_bvec) {
251 nvmet_req_complete(req, 0);
252 return;
253 }
254
255 if (nr_bvec > NVMET_MAX_INLINE_BIOVEC)
256 req->f.bvec = kmalloc_array(nr_bvec, sizeof(struct bio_vec),
257 GFP_KERNEL);
258 else
259 req->f.bvec = req->inline_bvec;
260
261 if (unlikely(!req->f.bvec)) {
262 /* fallback under memory pressure */
263 req->f.bvec = mempool_alloc(req->ns->bvec_pool, GFP_KERNEL);
264 req->f.mpool_alloc = true;
265 } else
266 req->f.mpool_alloc = false;
267
268 if (req->ns->buffered_io) {
269 if (likely(!req->f.mpool_alloc) &&
Maurizio Lombardif2a58ff2021-11-22 11:08:27 +0100270 (req->ns->file->f_mode & FMODE_NOWAIT) &&
271 nvmet_file_execute_io(req, IOCB_NOWAIT))
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500272 return;
273 nvmet_file_submit_buffered_io(req);
274 } else
275 nvmet_file_execute_io(req, 0);
276}
277
Chaitanya Kulkarnidedf0be2018-08-07 23:01:07 -0700278u16 nvmet_file_flush(struct nvmet_req *req)
279{
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800280 return errno_to_nvme_status(req, vfs_fsync(req->ns->file, 1));
Chaitanya Kulkarnidedf0be2018-08-07 23:01:07 -0700281}
282
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400283static void nvmet_file_flush_work(struct work_struct *w)
284{
285 struct nvmet_req *req = container_of(w, struct nvmet_req, f.work);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400286
Chaitanya Kulkarnidedf0be2018-08-07 23:01:07 -0700287 nvmet_req_complete(req, nvmet_file_flush(req));
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400288}
289
290static void nvmet_file_execute_flush(struct nvmet_req *req)
291{
Israel Rukshin136cc1f2020-05-19 17:05:59 +0300292 if (!nvmet_check_transfer_len(req, 0))
Christoph Hellwige9061c32019-10-23 10:35:44 -0600293 return;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400294 INIT_WORK(&req->f.work, nvmet_file_flush_work);
295 schedule_work(&req->f.work);
296}
297
298static void nvmet_file_execute_discard(struct nvmet_req *req)
299{
300 int mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE;
301 struct nvme_dsm_range range;
Sagi Grimberg1b72b712018-07-11 12:43:16 +0300302 loff_t offset, len;
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800303 u16 status = 0;
304 int ret;
Sagi Grimberg1b72b712018-07-11 12:43:16 +0300305 int i;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400306
307 for (i = 0; i <= le32_to_cpu(req->cmd->dsm.nr); i++) {
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800308 status = nvmet_copy_from_sgl(req, i * sizeof(range), &range,
Sagi Grimberg1b72b712018-07-11 12:43:16 +0300309 sizeof(range));
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800310 if (status)
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400311 break;
Sagi Grimberg9c891c12018-07-11 16:13:04 +0300312
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400313 offset = le64_to_cpu(range.slba) << req->ns->blksize_shift;
Bart Van Assche8eacd1b2018-10-08 14:28:52 -0700314 len = le32_to_cpu(range.nlb);
315 len <<= req->ns->blksize_shift;
Sagi Grimberg9c891c12018-07-11 16:13:04 +0300316 if (offset + len > req->ns->size) {
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800317 req->error_slba = le64_to_cpu(range.slba);
318 status = errno_to_nvme_status(req, -ENOSPC);
Sagi Grimberg9c891c12018-07-11 16:13:04 +0300319 break;
320 }
321
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800322 ret = vfs_fallocate(req->ns->file, mode, offset, len);
Christoph Hellwig005c6742019-03-13 18:55:09 +0100323 if (ret && ret != -EOPNOTSUPP) {
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800324 req->error_slba = le64_to_cpu(range.slba);
325 status = errno_to_nvme_status(req, ret);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400326 break;
Sagi Grimberg1b72b712018-07-11 12:43:16 +0300327 }
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400328 }
329
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800330 nvmet_req_complete(req, status);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400331}
332
333static void nvmet_file_dsm_work(struct work_struct *w)
334{
335 struct nvmet_req *req = container_of(w, struct nvmet_req, f.work);
336
337 switch (le32_to_cpu(req->cmd->dsm.attributes)) {
338 case NVME_DSMGMT_AD:
339 nvmet_file_execute_discard(req);
340 return;
341 case NVME_DSMGMT_IDR:
342 case NVME_DSMGMT_IDW:
343 default:
344 /* Not supported yet */
345 nvmet_req_complete(req, 0);
346 return;
347 }
348}
349
350static void nvmet_file_execute_dsm(struct nvmet_req *req)
351{
Sagi Grimbergb716e682020-01-26 23:23:28 -0800352 if (!nvmet_check_data_len_lte(req, nvmet_dsm_len(req)))
Christoph Hellwige9061c32019-10-23 10:35:44 -0600353 return;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400354 INIT_WORK(&req->f.work, nvmet_file_dsm_work);
355 schedule_work(&req->f.work);
356}
357
358static void nvmet_file_write_zeroes_work(struct work_struct *w)
359{
360 struct nvmet_req *req = container_of(w, struct nvmet_req, f.work);
361 struct nvme_write_zeroes_cmd *write_zeroes = &req->cmd->write_zeroes;
362 int mode = FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE;
363 loff_t offset;
364 loff_t len;
365 int ret;
366
367 offset = le64_to_cpu(write_zeroes->slba) << req->ns->blksize_shift;
368 len = (((sector_t)le16_to_cpu(write_zeroes->length) + 1) <<
369 req->ns->blksize_shift);
370
Sagi Grimberg9c891c12018-07-11 16:13:04 +0300371 if (unlikely(offset + len > req->ns->size)) {
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800372 nvmet_req_complete(req, errno_to_nvme_status(req, -ENOSPC));
Sagi Grimberg9c891c12018-07-11 16:13:04 +0300373 return;
374 }
375
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400376 ret = vfs_fallocate(req->ns->file, mode, offset, len);
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800377 nvmet_req_complete(req, ret < 0 ? errno_to_nvme_status(req, ret) : 0);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400378}
379
380static void nvmet_file_execute_write_zeroes(struct nvmet_req *req)
381{
Israel Rukshin136cc1f2020-05-19 17:05:59 +0300382 if (!nvmet_check_transfer_len(req, 0))
Christoph Hellwige9061c32019-10-23 10:35:44 -0600383 return;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400384 INIT_WORK(&req->f.work, nvmet_file_write_zeroes_work);
385 schedule_work(&req->f.work);
386}
387
388u16 nvmet_file_parse_io_cmd(struct nvmet_req *req)
389{
390 struct nvme_command *cmd = req->cmd;
391
392 switch (cmd->common.opcode) {
393 case nvme_cmd_read:
394 case nvme_cmd_write:
Chaitanya Kulkarni50a909d2018-11-14 01:12:19 -0500395 req->execute = nvmet_file_execute_rw;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400396 return 0;
397 case nvme_cmd_flush:
398 req->execute = nvmet_file_execute_flush;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400399 return 0;
400 case nvme_cmd_dsm:
401 req->execute = nvmet_file_execute_dsm;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400402 return 0;
403 case nvme_cmd_write_zeroes:
404 req->execute = nvmet_file_execute_write_zeroes;
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400405 return 0;
406 default:
407 pr_err("unhandled cmd for file ns %d on qid %d\n",
408 cmd->common.opcode, req->sq->qid);
Chaitanya Kulkarnic6aa3542018-12-12 15:11:43 -0800409 req->error_loc = offsetof(struct nvme_common_command, opcode);
Chaitanya Kulkarnid5eff332018-05-23 00:34:39 -0400410 return NVME_SC_INVALID_OPCODE | NVME_SC_DNR;
411 }
412}