lightnvm: refactor device ops->get_bb_tbl()
authorMatias Bjørling <m@bjorling.me>
Fri, 6 May 2016 18:03:05 +0000 (20:03 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 6 May 2016 18:51:10 +0000 (12:51 -0600)
commite11903f5dfeb4f59fe93316d47f2ee5982e91e60
treecff5ac80004af7b45bf3785889bb4ea04780943a
parent5136061ce705210b501ed9ecd673a67b74ebe017
lightnvm: refactor device ops->get_bb_tbl()

The device ops->get_bb_tbl() takes a callback, that allows the caller
to use its own callback function to update its data structures in the
returning function.

This makes it difficult to send parameters to the callback, and usually
is circumvented by small private structures, that both carry the callers
state and any flags needed to fulfill the update.

Refactor ops->get_bb_tbl() to fill a data buffer with the status of the
blocks returned, and let the user call the callback function manually.
That will provide the necessary flags and data structures and simplify
the logic around ops->get_bb_tbl().

Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/core.c
drivers/lightnvm/gennvm.c
drivers/lightnvm/sysblk.c
drivers/nvme/host/lightnvm.c
include/linux/lightnvm.h