aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2017-06-26 05:57:12 -0400
committerJens Axboe <axboe@kernel.dk>2017-06-26 18:24:53 -0400
commitcaa69fa560025d12c276abd62d58a87b94324708 (patch)
tree39d0e7ee808b05a2312b4133061e906a0d3a3410
parent613fa267c3fa2bdf92d005a4d0fa911bc84f17f4 (diff)
lightnvm: pblk: spare double cpu_to_le64 calc.
Spare a double calculation on the fast write path. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <matias@cnexlabs.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/lightnvm/pblk-map.c5
-rw-r--r--drivers/lightnvm/pblk-recovery.c4
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/lightnvm/pblk-map.c b/drivers/lightnvm/pblk-map.c
index 17c16955284d..18291c238930 100644
--- a/drivers/lightnvm/pblk-map.c
+++ b/drivers/lightnvm/pblk-map.c
@@ -53,8 +53,9 @@ static void pblk_map_page_data(struct pblk *pblk, unsigned int sentry,
53 lba_list[paddr] = cpu_to_le64(w_ctx->lba); 53 lba_list[paddr] = cpu_to_le64(w_ctx->lba);
54 le64_add_cpu(&line->emeta->nr_valid_lbas, 1); 54 le64_add_cpu(&line->emeta->nr_valid_lbas, 1);
55 } else { 55 } else {
56 meta_list[i].lba = cpu_to_le64(ADDR_EMPTY); 56 u64 addr_empty = cpu_to_le64(ADDR_EMPTY);
57 lba_list[paddr] = cpu_to_le64(ADDR_EMPTY); 57
58 lba_list[paddr] = meta_list[i].lba = addr_empty;
58 pblk_map_pad_invalidate(pblk, line, paddr); 59 pblk_map_pad_invalidate(pblk, line, paddr);
59 } 60 }
60 } 61 }
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index f8f85087cd3c..82787006b865 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -390,12 +390,12 @@ next_pad_rq:
390 390
391 for (j = 0; j < pblk->min_write_pgs; j++, i++, w_ptr++) { 391 for (j = 0; j < pblk->min_write_pgs; j++, i++, w_ptr++) {
392 struct ppa_addr dev_ppa; 392 struct ppa_addr dev_ppa;
393 u64 addr_empty = cpu_to_le64(ADDR_EMPTY);
393 394
394 dev_ppa = addr_to_gen_ppa(pblk, w_ptr, line->id); 395 dev_ppa = addr_to_gen_ppa(pblk, w_ptr, line->id);
395 396
396 pblk_map_invalidate(pblk, dev_ppa); 397 pblk_map_invalidate(pblk, dev_ppa);
397 meta_list[i].lba = cpu_to_le64(ADDR_EMPTY); 398 lba_list[w_ptr] = meta_list[i].lba = addr_empty;
398 lba_list[w_ptr] = cpu_to_le64(ADDR_EMPTY);
399 rqd->ppa_list[i] = dev_ppa; 399 rqd->ppa_list[i] = dev_ppa;
400 } 400 }
401 } 401 }