Skip to content

Commit

Permalink
lightnvm: pblk: spare double cpu_to_le64 calc.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Javier González authored and Jens Axboe committed Jun 26, 2017
1 parent 613fa26 commit caa69fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions drivers/lightnvm/pblk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ static void pblk_map_page_data(struct pblk *pblk, unsigned int sentry,
lba_list[paddr] = cpu_to_le64(w_ctx->lba);
le64_add_cpu(&line->emeta->nr_valid_lbas, 1);
} else {
meta_list[i].lba = cpu_to_le64(ADDR_EMPTY);
lba_list[paddr] = cpu_to_le64(ADDR_EMPTY);
u64 addr_empty = cpu_to_le64(ADDR_EMPTY);

lba_list[paddr] = meta_list[i].lba = addr_empty;
pblk_map_pad_invalidate(pblk, line, paddr);
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/lightnvm/pblk-recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,12 @@ static int pblk_recov_pad_oob(struct pblk *pblk, struct pblk_line *line,

for (j = 0; j < pblk->min_write_pgs; j++, i++, w_ptr++) {
struct ppa_addr dev_ppa;
u64 addr_empty = cpu_to_le64(ADDR_EMPTY);

dev_ppa = addr_to_gen_ppa(pblk, w_ptr, line->id);

pblk_map_invalidate(pblk, dev_ppa);
meta_list[i].lba = cpu_to_le64(ADDR_EMPTY);
lba_list[w_ptr] = cpu_to_le64(ADDR_EMPTY);
lba_list[w_ptr] = meta_list[i].lba = addr_empty;
rqd->ppa_list[i] = dev_ppa;
}
}
Expand Down

0 comments on commit caa69fa

Please sign in to comment.