]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: use type-name map for address family
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Mon, 4 May 2020 08:56:44 +0000 (01:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2020 22:18:36 +0000 (16:18 -0600)
commit4456744256b2a90bf939d87db25c5fb5fb80d436
tree87c687425c15f0667a543c4f360aecdcbbf04744
parentb37af5e852b7a534d0b9d1853ff1b869d6b50af7
nvmet: use type-name map for address family

Right now nvmet_addr_adrfam_[store|show]() uses switch and if else
ladder for address family to string and reverse mapping which also
repeats the strings in show and store function.

With addition of generic nvmet_type_name_map structure we can now get rid
of the switch and if else ladder and string duplication.

Also, we add a newline in before found label in nvmet_addr_trtype_store()
which keeps goto label code consistent with
nvmet_allowed_hosts_drop_link(), nvmet_port_subsys_drop_link() and
nvmet_ana_group_ana_state_store().

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/configfs.c