• Hans Holmberg's avatar
    lightnvm: introduce nvm_rq_to_ppa_list · d68a9344
    Hans Holmberg authored
    There is a number of places in the lightnvm subsystem where the user
    iterates over the ppa list. Before iterating, the user must know if it
    is a single or multiple LBAs due to vector commands using either the
    nvm_rq ->ppa_addr or ->ppa_list fields on command submission, which
    leads to open-coding the if/else statement.
    
    Instead of having multiple if/else's, move it into a function that can
    be called by its users.
    
    A nice side effect of this cleanup is that this patch fixes up a
    bunch of cases where we don't consider the single-ppa case in pblk.
    Signed-off-by: default avatarHans Holmberg <hans.holmberg@cnexlabs.com>
    Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    d68a9344
core.c 30.4 KB