All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <55E955DF.5020303@cn.fujitsu.com>

diff --git a/a/1.txt b/N1/1.txt
index 52c8255..295dda2 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,4 +1,4 @@
-On 09/04/2015 04:05 PM, Matias Bj?rling wrote:
+On 09/04/2015 04:05 PM, Matias Bjørling wrote:
 >>
 >> So here is a suggestion, register_bm again
 >> if we found nvm_dev->bm == NULL in create_target(). And if it is still
@@ -41,18 +41,3 @@ Yang
 >
 > .
 >
-
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: 0002-lightNVM-register-bm-in-nvm_create_target-if-dev-bm-.patch
-Type: text/x-patch
-Size: 1558 bytes
-Desc: not available
-URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20150904/62365bf4/attachment.bin>
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: 0001-lightNVM-fix-a-compatibility-problem-in-compiling.patch
-Type: text/x-patch
-Size: 5428 bytes
-Desc: not available
-URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20150904/62365bf4/attachment-0001.bin>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..fa234c8
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,6 @@
+Content-Type: text/x-patch;
+	name="0002-lightNVM-register-bm-in-nvm_create_target-if-dev-bm-.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename*0="0002-lightNVM-register-bm-in-nvm_create_target-if-dev-bm-.pa";
+	filename*1="tch"
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..0c377db
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,53 @@
+>From 2060232d379328679b22753587d16249f01fa219 Mon Sep 17 00:00:00 2001
+From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+Date: Fri, 4 Sep 2015 08:10:13 +0900
+Subject: [PATCH 2/2] lightNVM: register bm in nvm_create_target if dev->bm is
+ NULL
+
+When we create target, we need to make sure dev->bm is not NULL.
+If it's NULL try to register bm again. If we still fail to find
+a proper bm for this dev, return error rather than continue to
+provide a NULL pointer dereference problem later.
+
+Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+---
+ drivers/lightnvm/core.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
+index 5e4c2b8..9c75ea4 100644
+--- a/drivers/lightnvm/core.c
++++ b/drivers/lightnvm/core.c
+@@ -293,10 +293,30 @@ static int nvm_create_target(struct nvm_dev *dev, char *ttname, char *tname,
+ 						int lun_begin, int lun_end)
+ {
+ 	struct request_queue *tqueue;
++	struct nvm_bm_type *bt;
+ 	struct gendisk *tdisk;
+ 	struct nvm_tgt_type *tt;
+ 	struct nvm_target *t;
+ 	void *targetdata;
++	int ret = 0;
++
++	if (!dev->bm) {
++		/* register with device with a supported BM */
++		list_for_each_entry(bt, &nvm_bms, list) {
++			ret = bt->register_bm(dev);
++			if (ret < 0)
++				return ret; /* initialization failed */
++			if (ret > 0) {
++				dev->bm = bt;
++				break; /* successfully initialized */
++			}
++		}
++
++		if (!ret) {
++			pr_info("nvm: no compatible bm was found.\n");
++			return -ENODEV;
++		}
++	}
+ 
+ 	tt = nvm_find_target_type(ttname);
+ 	if (!tt) {
+-- 
+1.8.4.2
diff --git a/N1/3.hdr b/N1/3.hdr
new file mode 100644
index 0000000..919d78b
--- /dev/null
+++ b/N1/3.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+	name="0001-lightNVM-fix-a-compatibility-problem-in-compiling.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment;
+	filename="0001-lightNVM-fix-a-compatibility-problem-in-compiling.patch"
diff --git a/N1/3.txt b/N1/3.txt
new file mode 100644
index 0000000..d30f73c
--- /dev/null
+++ b/N1/3.txt
@@ -0,0 +1,170 @@
+>From 699d279ee0dbf3db5a4e7a78d52fb93e954294a1 Mon Sep 17 00:00:00 2001
+From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+Date: Mon, 31 Aug 2015 17:22:23 -0400
+Subject: [PATCH 1/2] lightNVM: fix a compatibility problem in compiling.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In some old gcc version, such as [gcc version 4.4.7 20120313 (Red Hat 4.4.7-4)]
+there is a compiling error with this kind of code:
+
+struct test {
+	union {
+		int data;
+	};
+};
+
+int main()
+{
+        struct test ins = {
+                .data = 1,
+        };
+        return 0;
+}
+
+ # gcc test.c
+ # test.c: In function ‘main’:
+ # test.c:12: error: unknown field ‘data’ specified in initializer
+
+This patch fix this problem to initialize it in a compatible way.
+
+Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
+---
+ drivers/block/nvme-lightnvm.c | 58 +++++++++++++++++++------------------------
+ 1 file changed, 26 insertions(+), 32 deletions(-)
+
+diff --git a/drivers/block/nvme-lightnvm.c b/drivers/block/nvme-lightnvm.c
+index 8ad84c9..d1dbc67 100644
+--- a/drivers/block/nvme-lightnvm.c
++++ b/drivers/block/nvme-lightnvm.c
+@@ -184,13 +184,13 @@ static int init_chnls(struct request_queue *q, struct nvm_id *nvm_id,
+ 	struct nvme_nvm_id_chnl *src = nvme_nvm_id->chnls;
+ 	struct nvm_id_chnl *dst = nvm_id->chnls;
+ 	struct nvme_ns *ns = q->queuedata;
+-	struct nvme_nvm_command c = {
+-		.nvm_identify.opcode = nvme_nvm_admin_identify,
+-		.nvm_identify.nsid = cpu_to_le32(ns->ns_id),
+-	};
++	struct nvme_nvm_command c = {};
+ 	unsigned int len = nvm_id->nchannels;
+ 	int i, end, ret, off = 0;
+ 
++	c.nvm_identify.opcode = nvme_nvm_admin_identify;
++	c.nvm_identify.nsid = cpu_to_le32(ns->ns_id);
++
+ 	while (len) {
+ 		end = min_t(u32, NVME_NVM_CHNLS_PR_REQ, len);
+ 
+@@ -230,13 +230,12 @@ static int nvme_nvm_identify(struct request_queue *q, struct nvm_id *nvm_id)
+ {
+ 	struct nvme_ns *ns = q->queuedata;
+ 	struct nvme_nvm_id *nvme_nvm_id;
+-	struct nvme_nvm_command c = {
+-		.nvm_identify.opcode = nvme_nvm_admin_identify,
+-		.nvm_identify.nsid = cpu_to_le32(ns->ns_id),
+-		.nvm_identify.chnl_off = 0,
+-	};
++	struct nvme_nvm_command c = {};
+ 	int ret;
+ 
++	c.nvm_identify.opcode = nvme_nvm_admin_identify;
++	c.nvm_identify.nsid = cpu_to_le32(ns->ns_id);
++	c.nvm_identify.chnl_off = 0;
+ 	nvme_nvm_id = kmalloc(4096, GFP_KERNEL);
+ 	if (!nvme_nvm_id)
+ 		return -ENOMEM;
+@@ -270,14 +269,13 @@ static int nvme_nvm_get_features(struct request_queue *q,
+ 						struct nvm_get_features *gf)
+ {
+ 	struct nvme_ns *ns = q->queuedata;
+-	struct nvme_nvm_command c = {
+-		.common.opcode = nvme_nvm_admin_get_features,
+-		.common.nsid = ns->ns_id,
+-	};
++	struct nvme_nvm_command c = {};
+ 	int sz = sizeof(struct nvm_get_features);
+ 	int ret;
+ 	u64 *resp;
+ 
++	c.common.opcode = nvme_nvm_admin_get_features;
++	c.common.nsid = ns->ns_id;
+ 	resp = kmalloc(sz, GFP_KERNEL);
+ 	if (!resp)
+ 		return -ENOMEM;
+@@ -297,12 +295,11 @@ done:
+ static int nvme_nvm_set_resp(struct request_queue *q, u64 resp)
+ {
+ 	struct nvme_ns *ns = q->queuedata;
+-	struct nvme_nvm_command c = {
+-		.nvm_resp.opcode = nvme_nvm_admin_set_resp,
+-		.nvm_resp.nsid = cpu_to_le32(ns->ns_id),
+-		.nvm_resp.resp = cpu_to_le64(resp),
+-	};
++	struct nvme_nvm_command c = {};
+ 
++	c.nvm_resp.opcode = nvme_nvm_admin_set_resp;
++	c.nvm_resp.nsid = cpu_to_le32(ns->ns_id);
++	c.nvm_resp.resp = cpu_to_le64(resp);
+ 	return nvme_submit_sync_cmd(q, (struct nvme_command *)&c, NULL, 0);
+ }
+ 
+@@ -311,16 +308,15 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u64 nlb,
+ {
+ 	struct nvme_ns *ns = q->queuedata;
+ 	struct nvme_dev *dev = ns->dev;
+-	struct nvme_nvm_command c = {
+-		.nvm_l2p.opcode = nvme_nvm_admin_get_l2p_tbl,
+-		.nvm_l2p.nsid = cpu_to_le32(ns->ns_id),
+-	};
++	struct nvme_nvm_command c = {};
+ 	u32 len = queue_max_hw_sectors(q) << 9;
+ 	u64 nlb_pr_rq = len / sizeof(u64);
+ 	u64 cmd_slba = slba;
+ 	void *entries;
+ 	int ret = 0;
+ 
++	c.nvm_l2p.opcode = nvme_nvm_admin_get_l2p_tbl;
++	c.nvm_l2p.nsid = cpu_to_le32(ns->ns_id);
+ 	entries = kmalloc(len, GFP_KERNEL);
+ 	if (!entries)
+ 		return -ENOMEM;
+@@ -365,15 +361,14 @@ static int nvme_nvm_get_bb_tbl(struct request_queue *q, int lunid,
+ {
+ 	struct nvme_ns *ns = q->queuedata;
+ 	struct nvme_dev *dev = ns->dev;
+-	struct nvme_nvm_command c = {
+-		.nvm_get_bb.opcode = nvme_nvm_admin_get_bb_tbl,
+-		.nvm_get_bb.nsid = cpu_to_le32(ns->ns_id),
+-		.nvm_get_bb.lbb = cpu_to_le32(lunid),
+-	};
++	struct nvme_nvm_command c = {};
+ 	void *bb_bitmap;
+ 	u16 bb_bitmap_size;
+ 	int ret = 0;
+ 
++	c.nvm_get_bb.opcode = nvme_nvm_admin_get_bb_tbl;
++	c.nvm_get_bb.nsid = cpu_to_le32(ns->ns_id);
++	c.nvm_get_bb.lbb = cpu_to_le32(lunid);
+ 	bb_bitmap_size = ((nr_blocks >> 15) + 1) * PAGE_SIZE;
+ 	bb_bitmap = kmalloc(bb_bitmap_size, GFP_KERNEL);
+ 	if (!bb_bitmap)
+@@ -471,12 +466,11 @@ static int nvme_nvm_submit_io(struct request_queue *q, struct nvm_rq *rqd)
+ static int nvme_nvm_erase_block(struct request_queue *q, sector_t block_id)
+ {
+ 	struct nvme_ns *ns = q->queuedata;
+-	struct nvme_nvm_command c = {
+-		.nvm_erase.opcode = nvme_nvm_cmd_erase,
+-		.nvm_erase.nsid = cpu_to_le32(ns->ns_id),
+-		.nvm_erase.blk_addr = cpu_to_le64(block_id),
+-	};
++	struct nvme_nvm_command c = {};
+ 
++	c.nvm_erase.opcode = nvme_nvm_cmd_erase;
++	c.nvm_erase.nsid = cpu_to_le32(ns->ns_id);
++	c.nvm_erase.blk_addr = cpu_to_le64(block_id);
+ 	return nvme_submit_sync_cmd(q, (struct nvme_command *)&c, NULL, 0);
+ }
+ 
+-- 
+1.8.4.2
diff --git a/a/content_digest b/N1/content_digest
index d67effc..86bab64 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -4,12 +4,22 @@
  "ref\055E6D41A.5060100@bjorling.me\0"
  "ref\055E94301.3010501@cn.fujitsu.com\0"
  "ref\055E950BA.50203@bjorling.me\0"
- "From\0yangds.fnst@cn.fujitsu.com (Dongsheng Yang)\0"
- "Subject\0[PATCH v7 1/5] lightnvm: Support for Open-Channel SSDs\0"
+ "From\0Dongsheng Yang <yangds.fnst@cn.fujitsu.com>\0"
+ "Subject\0Re: [PATCH v7 1/5] lightnvm: Support for Open-Channel SSDs\0"
  "Date\0Fri, 4 Sep 2015 16:27:11 +0800\0"
- "\00:1\0"
+ "To\0Matias Bj\303\270rling <m@bjorling.me>"
+  hch@infradead.org
+  axboe@fb.com
+  linux-fsdevel@vger.kernel.org
+  linux-kernel@vger.kernel.org
+ " linux-nvme@lists.infradead.org\0"
+ "Cc\0jg@lightnvm.io"
+  Stephen.Bates@pmcs.com
+  keith.busch@intel.com
+ " Matias Bj\303\270rling <mb@lightnvm.io>\0"
+ "\01:1\0"
  "b\0"
- "On 09/04/2015 04:05 PM, Matias Bj?rling wrote:\n"
+ "On 09/04/2015 04:05 PM, Matias Bj\303\270rling wrote:\n"
  ">>\n"
  ">> So here is a suggestion, register_bm again\n"
  ">> if we found nvm_dev->bm == NULL in create_target(). And if it is still\n"
@@ -51,21 +61,235 @@
  ">\n"
  ">\n"
  "> .\n"
- ">\n"
+ >
+ "\01:2\0"
+ "fn\00002-lightNVM-register-bm-in-nvm_create_target-if-dev-bm-.patch\0"
+ "b\0"
+ ">From 2060232d379328679b22753587d16249f01fa219 Mon Sep 17 00:00:00 2001\n"
+ "From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>\n"
+ "Date: Fri, 4 Sep 2015 08:10:13 +0900\n"
+ "Subject: [PATCH 2/2] lightNVM: register bm in nvm_create_target if dev->bm is\n"
+ " NULL\n"
+ "\n"
+ "When we create target, we need to make sure dev->bm is not NULL.\n"
+ "If it's NULL try to register bm again. If we still fail to find\n"
+ "a proper bm for this dev, return error rather than continue to\n"
+ "provide a NULL pointer dereference problem later.\n"
+ "\n"
+ "Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>\n"
+ "---\n"
+ " drivers/lightnvm/core.c | 20 ++++++++++++++++++++\n"
+ " 1 file changed, 20 insertions(+)\n"
+ "\n"
+ "diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c\n"
+ "index 5e4c2b8..9c75ea4 100644\n"
+ "--- a/drivers/lightnvm/core.c\n"
+ "+++ b/drivers/lightnvm/core.c\n"
+ "@@ -293,10 +293,30 @@ static int nvm_create_target(struct nvm_dev *dev, char *ttname, char *tname,\n"
+ " \t\t\t\t\t\tint lun_begin, int lun_end)\n"
+ " {\n"
+ " \tstruct request_queue *tqueue;\n"
+ "+\tstruct nvm_bm_type *bt;\n"
+ " \tstruct gendisk *tdisk;\n"
+ " \tstruct nvm_tgt_type *tt;\n"
+ " \tstruct nvm_target *t;\n"
+ " \tvoid *targetdata;\n"
+ "+\tint ret = 0;\n"
+ "+\n"
+ "+\tif (!dev->bm) {\n"
+ "+\t\t/* register with device with a supported BM */\n"
+ "+\t\tlist_for_each_entry(bt, &nvm_bms, list) {\n"
+ "+\t\t\tret = bt->register_bm(dev);\n"
+ "+\t\t\tif (ret < 0)\n"
+ "+\t\t\t\treturn ret; /* initialization failed */\n"
+ "+\t\t\tif (ret > 0) {\n"
+ "+\t\t\t\tdev->bm = bt;\n"
+ "+\t\t\t\tbreak; /* successfully initialized */\n"
+ "+\t\t\t}\n"
+ "+\t\t}\n"
+ "+\n"
+ "+\t\tif (!ret) {\n"
+ "+\t\t\tpr_info(\"nvm: no compatible bm was found.\\n\");\n"
+ "+\t\t\treturn -ENODEV;\n"
+ "+\t\t}\n"
+ "+\t}\n"
+ " \n"
+ " \ttt = nvm_find_target_type(ttname);\n"
+ " \tif (!tt) {\n"
+ "-- \n"
+ 1.8.4.2
+ "\01:3\0"
+ "fn\00001-lightNVM-fix-a-compatibility-problem-in-compiling.patch\0"
+ "b\0"
+ ">From 699d279ee0dbf3db5a4e7a78d52fb93e954294a1 Mon Sep 17 00:00:00 2001\n"
+ "From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>\n"
+ "Date: Mon, 31 Aug 2015 17:22:23 -0400\n"
+ "Subject: [PATCH 1/2] lightNVM: fix a compatibility problem in compiling.\n"
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+ "\n"
+ "In some old gcc version, such as [gcc version 4.4.7 20120313 (Red Hat 4.4.7-4)]\n"
+ "there is a compiling error with this kind of code:\n"
+ "\n"
+ "struct test {\n"
+ "\tunion {\n"
+ "\t\tint data;\n"
+ "\t};\n"
+ "};\n"
+ "\n"
+ "int main()\n"
+ "{\n"
+ "        struct test ins = {\n"
+ "                .data = 1,\n"
+ "        };\n"
+ "        return 0;\n"
+ "}\n"
+ "\n"
+ " # gcc test.c\n"
+ " # test.c: In function \342\200\230main\342\200\231:\n"
+ " # test.c:12: error: unknown field \342\200\230data\342\200\231 specified in initializer\n"
+ "\n"
+ "This patch fix this problem to initialize it in a compatible way.\n"
+ "\n"
+ "Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>\n"
+ "---\n"
+ " drivers/block/nvme-lightnvm.c | 58 +++++++++++++++++++------------------------\n"
+ " 1 file changed, 26 insertions(+), 32 deletions(-)\n"
  "\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: 0002-lightNVM-register-bm-in-nvm_create_target-if-dev-bm-.patch\n"
- "Type: text/x-patch\n"
- "Size: 1558 bytes\n"
- "Desc: not available\n"
- "URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20150904/62365bf4/attachment.bin>\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: 0001-lightNVM-fix-a-compatibility-problem-in-compiling.patch\n"
- "Type: text/x-patch\n"
- "Size: 5428 bytes\n"
- "Desc: not available\n"
- URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20150904/62365bf4/attachment-0001.bin>
+ "diff --git a/drivers/block/nvme-lightnvm.c b/drivers/block/nvme-lightnvm.c\n"
+ "index 8ad84c9..d1dbc67 100644\n"
+ "--- a/drivers/block/nvme-lightnvm.c\n"
+ "+++ b/drivers/block/nvme-lightnvm.c\n"
+ "@@ -184,13 +184,13 @@ static int init_chnls(struct request_queue *q, struct nvm_id *nvm_id,\n"
+ " \tstruct nvme_nvm_id_chnl *src = nvme_nvm_id->chnls;\n"
+ " \tstruct nvm_id_chnl *dst = nvm_id->chnls;\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.nvm_identify.opcode = nvme_nvm_admin_identify,\n"
+ "-\t\t.nvm_identify.nsid = cpu_to_le32(ns->ns_id),\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \tunsigned int len = nvm_id->nchannels;\n"
+ " \tint i, end, ret, off = 0;\n"
+ " \n"
+ "+\tc.nvm_identify.opcode = nvme_nvm_admin_identify;\n"
+ "+\tc.nvm_identify.nsid = cpu_to_le32(ns->ns_id);\n"
+ "+\n"
+ " \twhile (len) {\n"
+ " \t\tend = min_t(u32, NVME_NVM_CHNLS_PR_REQ, len);\n"
+ " \n"
+ "@@ -230,13 +230,12 @@ static int nvme_nvm_identify(struct request_queue *q, struct nvm_id *nvm_id)\n"
+ " {\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ " \tstruct nvme_nvm_id *nvme_nvm_id;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.nvm_identify.opcode = nvme_nvm_admin_identify,\n"
+ "-\t\t.nvm_identify.nsid = cpu_to_le32(ns->ns_id),\n"
+ "-\t\t.nvm_identify.chnl_off = 0,\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \tint ret;\n"
+ " \n"
+ "+\tc.nvm_identify.opcode = nvme_nvm_admin_identify;\n"
+ "+\tc.nvm_identify.nsid = cpu_to_le32(ns->ns_id);\n"
+ "+\tc.nvm_identify.chnl_off = 0;\n"
+ " \tnvme_nvm_id = kmalloc(4096, GFP_KERNEL);\n"
+ " \tif (!nvme_nvm_id)\n"
+ " \t\treturn -ENOMEM;\n"
+ "@@ -270,14 +269,13 @@ static int nvme_nvm_get_features(struct request_queue *q,\n"
+ " \t\t\t\t\t\tstruct nvm_get_features *gf)\n"
+ " {\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.common.opcode = nvme_nvm_admin_get_features,\n"
+ "-\t\t.common.nsid = ns->ns_id,\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \tint sz = sizeof(struct nvm_get_features);\n"
+ " \tint ret;\n"
+ " \tu64 *resp;\n"
+ " \n"
+ "+\tc.common.opcode = nvme_nvm_admin_get_features;\n"
+ "+\tc.common.nsid = ns->ns_id;\n"
+ " \tresp = kmalloc(sz, GFP_KERNEL);\n"
+ " \tif (!resp)\n"
+ " \t\treturn -ENOMEM;\n"
+ "@@ -297,12 +295,11 @@ done:\n"
+ " static int nvme_nvm_set_resp(struct request_queue *q, u64 resp)\n"
+ " {\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.nvm_resp.opcode = nvme_nvm_admin_set_resp,\n"
+ "-\t\t.nvm_resp.nsid = cpu_to_le32(ns->ns_id),\n"
+ "-\t\t.nvm_resp.resp = cpu_to_le64(resp),\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \n"
+ "+\tc.nvm_resp.opcode = nvme_nvm_admin_set_resp;\n"
+ "+\tc.nvm_resp.nsid = cpu_to_le32(ns->ns_id);\n"
+ "+\tc.nvm_resp.resp = cpu_to_le64(resp);\n"
+ " \treturn nvme_submit_sync_cmd(q, (struct nvme_command *)&c, NULL, 0);\n"
+ " }\n"
+ " \n"
+ "@@ -311,16 +308,15 @@ static int nvme_nvm_get_l2p_tbl(struct request_queue *q, u64 slba, u64 nlb,\n"
+ " {\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ " \tstruct nvme_dev *dev = ns->dev;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.nvm_l2p.opcode = nvme_nvm_admin_get_l2p_tbl,\n"
+ "-\t\t.nvm_l2p.nsid = cpu_to_le32(ns->ns_id),\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \tu32 len = queue_max_hw_sectors(q) << 9;\n"
+ " \tu64 nlb_pr_rq = len / sizeof(u64);\n"
+ " \tu64 cmd_slba = slba;\n"
+ " \tvoid *entries;\n"
+ " \tint ret = 0;\n"
+ " \n"
+ "+\tc.nvm_l2p.opcode = nvme_nvm_admin_get_l2p_tbl;\n"
+ "+\tc.nvm_l2p.nsid = cpu_to_le32(ns->ns_id);\n"
+ " \tentries = kmalloc(len, GFP_KERNEL);\n"
+ " \tif (!entries)\n"
+ " \t\treturn -ENOMEM;\n"
+ "@@ -365,15 +361,14 @@ static int nvme_nvm_get_bb_tbl(struct request_queue *q, int lunid,\n"
+ " {\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ " \tstruct nvme_dev *dev = ns->dev;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.nvm_get_bb.opcode = nvme_nvm_admin_get_bb_tbl,\n"
+ "-\t\t.nvm_get_bb.nsid = cpu_to_le32(ns->ns_id),\n"
+ "-\t\t.nvm_get_bb.lbb = cpu_to_le32(lunid),\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \tvoid *bb_bitmap;\n"
+ " \tu16 bb_bitmap_size;\n"
+ " \tint ret = 0;\n"
+ " \n"
+ "+\tc.nvm_get_bb.opcode = nvme_nvm_admin_get_bb_tbl;\n"
+ "+\tc.nvm_get_bb.nsid = cpu_to_le32(ns->ns_id);\n"
+ "+\tc.nvm_get_bb.lbb = cpu_to_le32(lunid);\n"
+ " \tbb_bitmap_size = ((nr_blocks >> 15) + 1) * PAGE_SIZE;\n"
+ " \tbb_bitmap = kmalloc(bb_bitmap_size, GFP_KERNEL);\n"
+ " \tif (!bb_bitmap)\n"
+ "@@ -471,12 +466,11 @@ static int nvme_nvm_submit_io(struct request_queue *q, struct nvm_rq *rqd)\n"
+ " static int nvme_nvm_erase_block(struct request_queue *q, sector_t block_id)\n"
+ " {\n"
+ " \tstruct nvme_ns *ns = q->queuedata;\n"
+ "-\tstruct nvme_nvm_command c = {\n"
+ "-\t\t.nvm_erase.opcode = nvme_nvm_cmd_erase,\n"
+ "-\t\t.nvm_erase.nsid = cpu_to_le32(ns->ns_id),\n"
+ "-\t\t.nvm_erase.blk_addr = cpu_to_le64(block_id),\n"
+ "-\t};\n"
+ "+\tstruct nvme_nvm_command c = {};\n"
+ " \n"
+ "+\tc.nvm_erase.opcode = nvme_nvm_cmd_erase;\n"
+ "+\tc.nvm_erase.nsid = cpu_to_le32(ns->ns_id);\n"
+ "+\tc.nvm_erase.blk_addr = cpu_to_le64(block_id);\n"
+ " \treturn nvme_submit_sync_cmd(q, (struct nvme_command *)&c, NULL, 0);\n"
+ " }\n"
+ " \n"
+ "-- \n"
+ 1.8.4.2
 
-c1a41af3923539915850aef3cac66509747a7f4d41ec006c4ef61922c79261d7
+0c1aa23978aad1c21751a96293ea86218352245face1701db583cb319adab6f6

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.