]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: stop recreating global caches
authorHans Holmberg <hans.holmberg@cnexlabs.com>
Tue, 9 Oct 2018 11:11:58 +0000 (13:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:07 +0000 (08:25 -0600)
commit4d2b9da859ff6260c61d79ee7d08c850e697efe4
tree05bf1d0ff69e95206cd7b6950380ff558e24af11
parent3236a6b1e00bdb50b10a9d5303f7307b0f8e3035
lightnvm: pblk: stop recreating global caches

Pblk should not create a set of global caches every time
a pblk instance is created. The global caches should be
made available only when there is one or more pblk instances.

This patch bundles the global caches together with a kref
keeping track of whether the caches should be available or not.

Also, turn the global pblk lock into a mutex that explicitly
protects the caches (as this was the only purpose of the lock).

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-init.c