From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-nvme@lists.infradead.org
Cc: sagi@grimberg.me, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
hch@lst.de
Subject: [PATCH 0/6] nvmet: configfs code clenaup and fix
Date: Sun, 19 Apr 2020 16:52:36 -0700 [thread overview]
Message-ID: <20200419235242.60355-1-chaitanya.kulkarni@wdc.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2057 bytes --]
Hi,
Over a period of time, configfs added different attributes and groups.
These groups and attributes have common type to name mapping
functionality with code and identical structures (see [1], [2] & [3]).
Where [1] and [2] adds a different structure which can be made generic
and can be resued by [3].
This patch-series adds a new generic structure for type to name mapping
which then used in the [1], [2] and [3] to align the code for
consistency with removing the code duplication of
struct nvmet_transport name and struct nvmet_ana_state_names.
We also introduce a pattern with for-loop-compare-success-return with
type name map.
In short we address following points :-
1. Introducing generic type (identifier) to name (string) structure
nvmet_type_name_map, by removing the private per attribute
specific structures (nvmet_transport_name & nvmet_ana_state_names)
for defining the type to name mapping.
2. Keeping the code consistent with the use of for loop and type-name
struct array iteration instead of the duplicating strings in if/else
latter and switch.
3. Having consistent coding pattern for type-name
for-loop-check-success-return so that future introduction(s) of per
attribute type-name will not add inconsistencies.
Regards,
Chaitanya
[1] struct nvmet_transport_name :-
commit <a5d18612295a0>("nvmet: refactor configfs transport type handling")
[2] struct nvmet_ana_state_names :-
commit <62ac0d32f74ea>("nvmet: support configuring ANA groups")
[3] nvmet_addr_adrfam_[store|show] :-
commit <a07b4970f464f>(" nvmet: add a generic NVMe target")
Chaitanya Kulkarni (6):
nvmet: add generic type-name mapping
nvmet: use type-name map for address family
nvmet: use type-name map for ana states
nvmet: use type-name map for address treq
nvmet: centralize port enable access for configfs
nvmet: align addrfam list to spec
drivers/nvme/target/configfs.c | 225 +++++++++++++++++----------------
include/linux/nvme.h | 2 +
2 files changed, 116 insertions(+), 111 deletions(-)
--
2.22.1
[-- Attachment #2: Type: text/plain, Size: 158 bytes --]
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next reply other threads:[~2020-04-19 23:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 23:52 Chaitanya Kulkarni [this message]
2020-04-19 23:52 ` [PATCH 1/6] nvmet: add generic type-name mapping Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 2/6] nvmet: use type-name map for address family Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 3/6] nvmet: use type-name map for ana states Chaitanya Kulkarni
2020-04-22 8:31 ` Christoph Hellwig
2020-04-19 23:52 ` [PATCH 4/6] nvmet: use type-name map for address treq Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 5/6] nvmet: centralize port enable access for configfs Chaitanya Kulkarni
2020-04-22 8:32 ` Christoph Hellwig
2020-04-23 6:07 ` Chaitanya Kulkarni
2020-04-19 23:52 ` [PATCH 6/6] nvmet: align addrfam list to spec Chaitanya Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200419235242.60355-1-chaitanya.kulkarni@wdc.com \
--to=chaitanya.kulkarni@wdc.com \
--cc=hch@lst.de \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).