diff options
author | Javier González <javier@javigon.com> | 2018-10-09 13:11:42 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-10-09 08:25:06 -0600 |
commit | cb21665c8d13bb7e1f6e211442c53f4675f1569d (patch) | |
tree | 66f4205ee194150f918fb4588719a6b2bf7bac74 /drivers/lightnvm/pblk-read.c | |
parent | 2cf99bbd106f89fc72f778e8ad9d5538f1ef939b (diff) | |
download | linux-cb21665c8d13bb7e1f6e211442c53f4675f1569d.tar.gz linux-cb21665c8d13bb7e1f6e211442c53f4675f1569d.tar.bz2 linux-cb21665c8d13bb7e1f6e211442c53f4675f1569d.zip |
lightnvm: pblk: improve line helpers
The current helper to obtain a line from a ppa returns the line id,
which requires its users to explicitly retrieve the pointer to the line
with the id.
Make 2 different helpers: one returning the line id and one returning
the line directly.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-read.c')
-rw-r--r-- | drivers/lightnvm/pblk-read.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c index ad1d7713bbda..49744caaa300 100644 --- a/drivers/lightnvm/pblk-read.c +++ b/drivers/lightnvm/pblk-read.c @@ -252,9 +252,9 @@ static void pblk_end_partial_read(struct nvm_rq *rqd) i = 0; hole = find_first_zero_bit(read_bitmap, nr_secs); do { - int line_id = pblk_ppa_to_line(rqd->ppa_list[i]); - struct pblk_line *line = &pblk->lines[line_id]; + struct pblk_line *line; + line = pblk_ppa_to_line(pblk, rqd->ppa_list[i]); kref_put(&line->ref, pblk_line_put); meta_list[hole].lba = lba_list_media[i]; |