diff options
author | Javier González <javier@javigon.com> | 2018-10-09 07:11:42 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-10-09 10:25:06 -0400 |
commit | cb21665c8d13bb7e1f6e211442c53f4675f1569d (patch) | |
tree | 66f4205ee194150f918fb4588719a6b2bf7bac74 /drivers/lightnvm/pblk-write.c | |
parent | 2cf99bbd106f89fc72f778e8ad9d5538f1ef939b (diff) |
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-write.c')
-rw-r--r-- | drivers/lightnvm/pblk-write.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c index df99c45778d4..c23b65aaa27b 100644 --- a/drivers/lightnvm/pblk-write.c +++ b/drivers/lightnvm/pblk-write.c | |||
@@ -113,7 +113,7 @@ static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa) | |||
113 | u64 paddr; | 113 | u64 paddr; |
114 | int done = 0; | 114 | int done = 0; |
115 | 115 | ||
116 | line = &pblk->lines[pblk_ppa_to_line(*ppa)]; | 116 | line = pblk_ppa_to_line(pblk, *ppa); |
117 | spin_lock(&line->lock); | 117 | spin_lock(&line->lock); |
118 | 118 | ||
119 | while (!done) { | 119 | while (!done) { |
@@ -171,7 +171,7 @@ static void pblk_prepare_resubmit(struct pblk *pblk, unsigned int sentry, | |||
171 | /* Decrese the reference count to the line as we will | 171 | /* Decrese the reference count to the line as we will |
172 | * re-map these entries | 172 | * re-map these entries |
173 | */ | 173 | */ |
174 | line = &pblk->lines[pblk_ppa_to_line(w_ctx->ppa)]; | 174 | line = pblk_ppa_to_line(pblk, w_ctx->ppa); |
175 | kref_put(&line->ref, pblk_line_put); | 175 | kref_put(&line->ref, pblk_line_put); |
176 | 176 | ||
177 | pos = (pos + 1) & (rb->nr_entries - 1); | 177 | pos = (pos + 1) & (rb->nr_entries - 1); |