• Chaitanya Kulkarni's avatar
    nvme: use an xarray to lookup the Commands Supported and Effects log · 1cf7a12e
    Chaitanya Kulkarni authored
    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: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
    Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    1cf7a12e
core.c 120 KB