]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: introduce nvm_for_each_lun_ppa() macro
authorMatias Bjørling <m@bjorling.me>
Fri, 6 May 2016 18:03:04 +0000 (20:03 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 6 May 2016 18:51:10 +0000 (12:51 -0600)
commit0b5b1aa577b2ba8dc78d8de54281ac2eac5378b3
tree9d53516525698e1a8576cabb324bbce2c78b8f8f
parent9c5f2bd784692fd8b766880e432a573d58427e79
lightnvm: introduce nvm_for_each_lun_ppa() macro

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: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/sysblk.c
include/linux/lightnvm.h