nvmet: use type-name map for address treq
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Mon, 4 May 2020 08:56:46 +0000 (01:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2020 22:18:36 +0000 (16:18 -0600)
commit87628e2851008d5b0e53859f6062988c6d66d7f5
treef12e113ffdfb6398bcdeac04bdb6afc6aa708a4a
parent84b8d0d7aa159652dc191d58c4d353b6c9173c54
nvmet: use type-name map for address treq

Currently nvmet_addr_treq_[store|show]() uses switch and if else
ladder for address transport requirements to string and reverse
mapping. With addtion of the generic nvmet_type_name_map structure
we can get rid of the switch and if else ladder with string
duplication.

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