]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: use an xarray to lookup the Commands Supported and Effects log
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tue, 22 Sep 2020 21:05:29 +0000 (14:05 -0700)
committerChristoph Hellwig <hch@lst.de>
Sun, 27 Sep 2020 07:14:18 +0000 (09:14 +0200)
commitad5fe2b9b6f9dffb78c98ff88b3a2e41b9929b5a
treee10d72b76baadf6dba04d74b4c1c833f06fd1360
parent0a0e66da82fc376a63d3d8ea360c9de3f7a90f4e
nvme: use an xarray to lookup the Commands Supported and Effects log

When using linked list we have to open code the locking, search, and
destroy operations with the loops even if data structure doesn't fall
into the fast path.

One of the main advantage of having XArray to store, search, and remove
items is that it handles all the locking by itself, avoids the loops
when using linked lists, provides clear API to replace the linked list's
search and destroy loops.

This patch replaces the ctrl->cel list with XArray and removes :-

a. Extra code needed for the linked list for ctrl->cel item management
   such as nvme_find_cel().
b. Destroy loop in the nvme_free_ctrl().
c. Explicit insertion locking in the nvme_get_effects_log().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h