OSDN Git Service

lightnvm: pblk: simplify partial read path
authorIgor Konopko <igor.j.konopko@intel.com>
Sat, 4 May 2019 18:38:10 +0000 (20:38 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 May 2019 16:19:19 +0000 (10:19 -0600)
commita96de64a24e5035018c5a912f2b877da8797277e
tree3d3a80a71cce270dca5ebed4cbe6c9133e0d7752
parent843f2edbdde085b4d2764baf6fd8a1fccb1ab26a
lightnvm: pblk: simplify partial read path

This patch changes the approach to handling partial read path.

In old approach merging of data from round buffer and drive was fully
made by drive. This had some disadvantages - code was complex and
relies on bio internals, so it was hard to maintain and was strongly
dependent on bio changes.

In new approach most of the handling is done mostly by block layer
functions such as bio_split(), bio_chain() and generic_make request()
and generally is less complex and easier to maintain. Below some more
details of the new approach.

When read bio arrives, it is cloned for pblk internal purposes. All
the L2P mapping, which includes copying data from round buffer to bio
and thus bio_advance() calls is done on the cloned bio, so the original
bio is untouched. If we found that we have partial read case, we
still have original bio untouched, so we can split it and continue to
process only first part of it in current context, when the rest will be
called as separate bio request which is passed to generic_make_request()
for further processing.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Reviewed-by: Heiner Litz <hlitz@ucsc.edu>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-rb.c
drivers/lightnvm/pblk-read.c
drivers/lightnvm/pblk.h