@@ -1043,12 +1043,11 @@ static int nvme_ctrl_scan_path(struct nvme_global_ctx *ctx, struct nvme_ctrl *c,
10431043struct nvme_transport_handle * nvme_ctrl_get_transport_handle (nvme_ctrl_t c )
10441044{
10451045 if (!c -> hdl ) {
1046- struct nvme_global_ctx * ctx = ctx_from_ctrl (c );
10471046 int err ;
10481047
1049- err = nvme_open (ctx , c -> name , & c -> hdl );
1048+ err = nvme_open (c -> ctx , c -> name , & c -> hdl );
10501049 if (err )
1051- nvme_msg (ctx , LOG_ERR ,
1050+ nvme_msg (c -> ctx , LOG_ERR ,
10521051 "Failed to open ctrl %s, errno %d\n" ,
10531052 c -> name , err );
10541053 }
@@ -1104,7 +1103,7 @@ char *nvme_ctrl_get_src_addr(nvme_ctrl_t c, char *src_addr, size_t src_addr_len)
11041103 p += strlen ("src_addr=" );
11051104 l = strcspn (p , ",%" ); /* % to eliminate IPv6 scope (if present) */
11061105 if (l >= src_addr_len ) {
1107- nvme_msg (ctx_from_ctrl ( c ) , LOG_ERR ,
1106+ nvme_msg (c -> ctx , LOG_ERR ,
11081107 "Buffer for src_addr is too small (%zu must be > %zu)\n" ,
11091108 src_addr_len , l );
11101109 return NULL ;
@@ -1514,7 +1513,7 @@ static bool _tcp_ctrl_match_host_traddr_no_src_addr(struct nvme_ctrl *c, struct
15141513 * 100% positive match. Regardless, let's be optimistic
15151514 * and assume that we have a match.
15161515 */
1517- nvme_msg (ctx_from_ctrl ( c ) , LOG_DEBUG ,
1516+ nvme_msg (c -> ctx , LOG_DEBUG ,
15181517 "Not enough data, but assume %s matches candidate's host_traddr: %s\n" ,
15191518 nvme_ctrl_get_name (c ), candidate -> host_traddr );
15201519
@@ -1554,7 +1553,7 @@ static bool _tcp_ctrl_match_host_iface_no_src_addr(struct nvme_ctrl *c, struct c
15541553 * 100% positive match. Regardless, let's be optimistic
15551554 * and assume that we have a match.
15561555 */
1557- nvme_msg (ctx_from_ctrl ( c ) , LOG_DEBUG ,
1556+ nvme_msg (c -> ctx , LOG_DEBUG ,
15581557 "Not enough data, but assume %s matches candidate's host_iface: %s\n" ,
15591558 nvme_ctrl_get_name (c ), candidate -> host_iface );
15601559
@@ -2358,12 +2357,11 @@ static int nvme_bytes_to_lba(nvme_ns_t n, off_t offset, size_t count,
23582357struct nvme_transport_handle * nvme_ns_get_transport_handle (nvme_ns_t n )
23592358{
23602359 if (!n -> hdl ) {
2361- struct nvme_global_ctx * ctx = ctx_from_ns (n );
23622360 int err ;
23632361
2364- err = nvme_open (ctx , n -> name , & n -> hdl );
2362+ err = nvme_open (n -> ctx , n -> name , & n -> hdl );
23652363 if (err )
2366- nvme_msg (ctx , LOG_ERR ,
2364+ nvme_msg (n -> ctx , LOG_ERR ,
23672365 "Failed to open ns %s, error %d\n" ,
23682366 n -> name , err );
23692367 }
0 commit comments