nvmet: centralize port enable access for configfs
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Mon, 4 May 2020 08:56:47 +0000 (01:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 May 2020 22:18:36 +0000 (16:18 -0600)
commit3ecb5faa07c7fd33a3ce1a8340841aa368df7d43
treef22e7eacbf502bc80f88400df726ae629917b3f9
parent87628e2851008d5b0e53859f6062988c6d66d7f5
nvmet: centralize port enable access for configfs

The configfs attributes which are supposed to set when port is disable
such as addr[addrfam|portid|traddr|treq|trsvcid|inline_data_size|trtype]
has repetitive check and generic error message printing.

This patch creates centralize helper to check and print an error
message that also accepts caller as a parameter. This makes error
message easy to parse for the user, removes the duplicate code and
makes it available for futures such scenarios.

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