OSDN Git Service

nvme-auth: convert dhchap_auth_list to an array
authorSagi Grimberg <sagi@grimberg.me>
Sun, 13 Nov 2022 11:24:20 +0000 (13:24 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 16 Nov 2022 07:36:36 +0000 (08:36 +0100)
commitaa36d711e945e65fa87410927800f01878a8faed
tree308d2023e10db00934cc1a631f20951829b38906
parent546dea18c99928bb81392de63092da0e25d07b10
nvme-auth: convert dhchap_auth_list to an array

We know exactly how many dhchap contexts we will need, there is no need
to hold a list that we need to protect with a mutex. Convert to
a dynamically allocated array. And dhchap_context access state is
maintained by the chap itself.

Make dhchap_auth_mutex protect only the ctrl host_key and ctrl_key
in a fine-grained lock such that there is no long lasting acquisition
of the lock and no need to take/release this lock when flushing
authentication works.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/auth.c
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h