@@ -557,7 +557,7 @@ struct nvme_subsystem *nvme_alloc_subsystem(struct nvme_host *h,
557557 list_head_init (& s -> ctrls );
558558 list_head_init (& s -> namespaces );
559559 list_node_init (& s -> entry );
560- list_add (& h -> subsystems , & s -> entry );
560+ list_add_tail (& h -> subsystems , & s -> entry );
561561 h -> r -> modified = true;
562562 return s ;
563563}
@@ -641,7 +641,7 @@ struct nvme_host *nvme_lookup_host(nvme_root_t r, const char *hostnqn,
641641 list_head_init (& h -> subsystems );
642642 list_node_init (& h -> entry );
643643 h -> r = r ;
644- list_add (& r -> hosts , & h -> entry );
644+ list_add_tail (& r -> hosts , & h -> entry );
645645 r -> modified = true;
646646
647647 return h ;
@@ -831,7 +831,7 @@ static void nvme_subsystem_set_path_ns(nvme_subsystem_t s, nvme_path_t p)
831831 sprintf (n_name , "nvme%dn%d" , i , nsid );
832832 nvme_subsystem_for_each_ns (s , n ) {
833833 if (!strcmp (n_name , nvme_ns_get_name (n ))) {
834- list_add (& n -> paths , & p -> nentry );
834+ list_add_tail (& n -> paths , & p -> nentry );
835835 p -> n = n ;
836836 }
837837 }
@@ -877,7 +877,7 @@ static int nvme_ctrl_scan_path(nvme_root_t r, struct nvme_ctrl *c, char *name)
877877 list_node_init (& p -> nentry );
878878 nvme_subsystem_set_path_ns (c -> s , p );
879879 list_node_init (& p -> entry );
880- list_add (& c -> paths , & p -> entry );
880+ list_add_tail (& c -> paths , & p -> entry );
881881 return 0 ;
882882}
883883
@@ -1680,7 +1680,7 @@ nvme_ctrl_t nvme_lookup_ctrl(nvme_subsystem_t s, const char *transport,
16801680 host_traddr , host_iface , trsvcid );
16811681 if (c ) {
16821682 c -> s = s ;
1683- list_add (& s -> ctrls , & c -> entry );
1683+ list_add_tail (& s -> ctrls , & c -> entry );
16841684 s -> h -> r -> modified = true;
16851685 }
16861686 return c ;
@@ -1896,7 +1896,7 @@ int nvme_init_ctrl(nvme_host_t h, nvme_ctrl_t c, int instance)
18961896 if (s -> subsystype && !strcmp (s -> subsystype , "discovery" ))
18971897 c -> discovery_ctrl = true;
18981898 c -> s = s ;
1899- list_add (& s -> ctrls , & c -> entry );
1899+ list_add_tail (& s -> ctrls , & c -> entry );
19001900 return ret ;
19011901}
19021902
@@ -2670,7 +2670,7 @@ static int nvme_ctrl_scan_namespace(nvme_root_t r, struct nvme_ctrl *c,
26702670 }
26712671 n -> s = c -> s ;
26722672 n -> c = c ;
2673- list_add (& c -> namespaces , & n -> entry );
2673+ list_add_tail (& c -> namespaces , & n -> entry );
26742674 return 0 ;
26752675}
26762676
@@ -2693,7 +2693,7 @@ static void nvme_subsystem_set_ns_path(nvme_subsystem_t s, nvme_ns_t n)
26932693 if (ret != 3 )
26942694 continue ;
26952695 if (ns_ctrl == p_subsys && ns_nsid == p_nsid ) {
2696- list_add (& n -> paths , & p -> nentry );
2696+ list_add_tail (& n -> paths , & p -> nentry );
26972697 p -> n = n ;
26982698 }
26992699 }
@@ -2731,7 +2731,7 @@ static int nvme_subsystem_scan_namespace(nvme_root_t r, nvme_subsystem_t s,
27312731 __nvme_free_ns (_n );
27322732 }
27332733 n -> s = s ;
2734- list_add (& s -> namespaces , & n -> entry );
2734+ list_add_tail (& s -> namespaces , & n -> entry );
27352735 nvme_subsystem_set_ns_path (s , n );
27362736 return 0 ;
27372737}
0 commit comments