aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/core.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2016-05-06 14:03:20 -0400
committerJens Axboe <axboe@fb.com>2016-05-06 14:51:10 -0400
commit6d5be9590b5e15124e3c8b319c8d7ce01abcf07d (patch)
tree7d3203bb0aa3a59de19f4cbb4de1c8b4502dd63c /drivers/lightnvm/core.c
parentdf414b33bb1eb3a0ae52ccd4ecfec9323a4f89dc (diff)
lightnvm: rename nr_pages to nr_ppas on nvm_rq
The number of ppas contained on a request is not necessarily the number of pages that it maps to neither on the target nor on the device side. In order to avoid confusion, rename nr_pages to nr_ppas since it is what the variable actually contains. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/core.c')
-rw-r--r--drivers/lightnvm/core.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index d3af77102e47..160c1a6838e1 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -226,8 +226,8 @@ void nvm_addr_to_generic_mode(struct nvm_dev *dev, struct nvm_rq *rqd)
226{ 226{
227 int i; 227 int i;
228 228
229 if (rqd->nr_pages > 1) { 229 if (rqd->nr_ppas > 1) {
230 for (i = 0; i < rqd->nr_pages; i++) 230 for (i = 0; i < rqd->nr_ppas; i++)
231 rqd->ppa_list[i] = dev_to_generic_addr(dev, 231 rqd->ppa_list[i] = dev_to_generic_addr(dev,
232 rqd->ppa_list[i]); 232 rqd->ppa_list[i]);
233 } else { 233 } else {
@@ -240,8 +240,8 @@ void nvm_generic_to_addr_mode(struct nvm_dev *dev, struct nvm_rq *rqd)
240{ 240{
241 int i; 241 int i;
242 242
243 if (rqd->nr_pages > 1) { 243 if (rqd->nr_ppas > 1) {
244 for (i = 0; i < rqd->nr_pages; i++) 244 for (i = 0; i < rqd->nr_ppas; i++)
245 rqd->ppa_list[i] = generic_to_dev_addr(dev, 245 rqd->ppa_list[i] = generic_to_dev_addr(dev,
246 rqd->ppa_list[i]); 246 rqd->ppa_list[i]);
247 } else { 247 } else {
@@ -256,13 +256,13 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd,
256 int i, plane_cnt, pl_idx; 256 int i, plane_cnt, pl_idx;
257 257
258 if ((!vblk || dev->plane_mode == NVM_PLANE_SINGLE) && nr_ppas == 1) { 258 if ((!vblk || dev->plane_mode == NVM_PLANE_SINGLE) && nr_ppas == 1) {
259 rqd->nr_pages = nr_ppas; 259 rqd->nr_ppas = nr_ppas;
260 rqd->ppa_addr = ppas[0]; 260 rqd->ppa_addr = ppas[0];
261 261
262 return 0; 262 return 0;
263 } 263 }
264 264
265 rqd->nr_pages = nr_ppas; 265 rqd->nr_ppas = nr_ppas;
266 rqd->ppa_list = nvm_dev_dma_alloc(dev, GFP_KERNEL, &rqd->dma_ppa_list); 266 rqd->ppa_list = nvm_dev_dma_alloc(dev, GFP_KERNEL, &rqd->dma_ppa_list);
267 if (!rqd->ppa_list) { 267 if (!rqd->ppa_list) {
268 pr_err("nvm: failed to allocate dma memory\n"); 268 pr_err("nvm: failed to allocate dma memory\n");
@@ -274,7 +274,7 @@ int nvm_set_rqd_ppalist(struct nvm_dev *dev, struct nvm_rq *rqd,
274 rqd->ppa_list[i] = ppas[i]; 274 rqd->ppa_list[i] = ppas[i];
275 } else { 275 } else {
276 plane_cnt = dev->plane_mode; 276 plane_cnt = dev->plane_mode;
277 rqd->nr_pages *= plane_cnt; 277 rqd->nr_ppas *= plane_cnt;
278 278
279 for (i = 0; i < nr_ppas; i++) { 279 for (i = 0; i < nr_ppas; i++) {
280 for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) { 280 for (pl_idx = 0; pl_idx < plane_cnt; pl_idx++) {
@@ -395,7 +395,7 @@ int nvm_submit_ppa_list(struct nvm_dev *dev, struct ppa_addr *ppa_list,
395 395
396 memset(&rqd, 0, sizeof(struct nvm_rq)); 396 memset(&rqd, 0, sizeof(struct nvm_rq));
397 397
398 rqd.nr_pages = nr_ppas; 398 rqd.nr_ppas = nr_ppas;
399 if (nr_ppas > 1) 399 if (nr_ppas > 1)
400 rqd.ppa_list = ppa_list; 400 rqd.ppa_list = ppa_list;
401 else 401 else