• Igor Konopko's avatar
    lightnvm: pblk: simplify partial read path · a96de64a
    Igor Konopko authored
    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: default avatarIgor Konopko <igor.j.konopko@intel.com>
    Reviewed-by: default avatarHeiner Litz <hlitz@ucsc.edu>
    Reviewed-by: default avatarJavier González <javier@javigon.com>
    Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    a96de64a
pblk-rb.c 20.8 KB