All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/6] nvmet: configfs code clenaup and fix
@ 2020-05-04  8:56 Chaitanya Kulkarni
  2020-05-04  8:56 ` [PATCH V2 1/6] nvmet: add generic type-name mapping Chaitanya Kulkarni
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Chaitanya Kulkarni @ 2020-05-04  8:56 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, Chaitanya Kulkarni, sagi

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1953 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.

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.

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")

Changes from V1:-
1. Keep goto found pattern.
2. Remove locking for port->enabled in the 5th patch.
3. Update the commit descriptions accoeding to changes.

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 | 184 ++++++++++++++++-----------------
 include/linux/nvme.h           |   2 +
 2 files changed, 91 insertions(+), 95 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-06  6:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04  8:56 [PATCH V2 0/6] nvmet: configfs code clenaup and fix Chaitanya Kulkarni
2020-05-04  8:56 ` [PATCH V2 1/6] nvmet: add generic type-name mapping Chaitanya Kulkarni
2020-05-04  8:56 ` [PATCH V2 2/6] nvmet: use type-name map for address family Chaitanya Kulkarni
2020-05-04  8:56 ` [PATCH V2 3/6] nvmet: use type-name map for ana states Chaitanya Kulkarni
2020-05-04  8:56 ` [PATCH V2 4/6] nvmet: use type-name map for address treq Chaitanya Kulkarni
2020-05-04  8:56 ` [PATCH V2 5/6] nvmet: centralize port enable access for configfs Chaitanya Kulkarni
2020-05-04  8:56 ` [PATCH V2 6/6] nvmet: align addrfam list to spec Chaitanya Kulkarni
2020-05-06  6:57 ` [PATCH V2 0/6] nvmet: configfs code clenaup and fix Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.