• M
    lightnvm: introduce nvm_for_each_lun_ppa() macro · 5136061c
    Matias Bjørling 提交于
    Users that wish to iterate all luns on a device. Must create a
    struct ppa_addr and separate iterators for channels and luns. To set the
    iterators, two loops are required, one to iterate channels, and another
    to iterate luns. This leads to decrease in readability.
    
    Introduce nvm_for_each_lun_ppa, which implements the nested loop and
    sets ppa, channel, and lun variable for each loop body, eliminating
    the boilerplate code.
    Signed-off-by: NMatias Bjørling <m@bjorling.me>
    Signed-off-by: NJens Axboe <axboe@fb.com>
    5136061c
lightnvm.h 13.7 KB