Skip to content

Commit c284f2b

Browse files
committed
fabrics: reorder and align fabric_args assigments
Follow the same order for describing the fabrics configuration. This will make is simpler to replace fabrics_args with nvmf_context. While at it also fix the assignments alignment. Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent db0a803 commit c284f2b

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

libnvme/src/nvme/fabrics.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,9 +2141,9 @@ static int _nvmf_discovery(struct nvme_global_ctx *ctx,
21412141
.subsysnqn = e->subnqn,
21422142
.transport = nvmf_trtype_str(e->trtype),
21432143
.traddr = e->traddr,
2144+
.trsvcid = e->trsvcid,
21442145
.host_traddr = fctx->host_traddr,
21452146
.host_iface = fctx->host_iface,
2146-
.trsvcid = e->trsvcid,
21472147
};
21482148

21492149
/* Already connected ? */
@@ -2400,12 +2400,12 @@ int _discovery_config_json(struct nvme_global_ctx *ctx,
24002400
memcpy(&cfg, fctx->cfg, sizeof(cfg));
24012401

24022402
struct fabric_args trcfg = {
2403-
.subsysnqn = subsysnqn,
2404-
.transport = transport,
2405-
.traddr = traddr,
2406-
.host_traddr = host_traddr,
2407-
.host_iface = host_iface,
2408-
.trsvcid = trsvcid,
2403+
.subsysnqn = subsysnqn,
2404+
.transport = transport,
2405+
.traddr = traddr,
2406+
.trsvcid = trsvcid,
2407+
.host_traddr = host_traddr,
2408+
.host_iface = host_iface,
24092409
};
24102410

24112411
if (!force) {
@@ -2561,12 +2561,12 @@ int nvmf_discovery_config_file(struct nvme_global_ctx *ctx,
25612561
break;
25622562

25632563
struct fabric_args trcfg = {
2564-
.transport = fctx->transport,
2565-
.traddr = fctx->traddr,
2566-
.trsvcid = fctx->trsvcid,
2567-
.subsysnqn = fctx->subsysnqn,
2568-
.host_traddr = fctx->host_traddr,
2569-
.host_iface = fctx->host_iface,
2564+
.subsysnqn = fctx->subsysnqn,
2565+
.transport = fctx->transport,
2566+
.traddr = fctx->traddr,
2567+
.trsvcid = fctx->trsvcid,
2568+
.host_traddr = fctx->host_traddr,
2569+
.host_iface = fctx->host_iface,
25702570
};
25712571

25722572
if (!force) {
@@ -2929,9 +2929,9 @@ int nvmf_discovery_nbft(struct nvme_global_ctx *ctx,
29292929
.subsysnqn = (*ss)->subsys_nqn,
29302930
.transport = (*ss)->transport,
29312931
.traddr = (*ss)->traddr,
2932+
.trsvcid = (*ss)->trsvcid,
29322933
.host_traddr = host_traddr,
29332934
.host_iface = NULL,
2934-
.trsvcid = (*ss)->trsvcid,
29352935
};
29362936

29372937
rr = nbft_connect(ctx, fctx, h, NULL,
@@ -3019,9 +3019,9 @@ int nvmf_discovery_nbft(struct nvme_global_ctx *ctx,
30193019
.subsysnqn = NVME_DISC_SUBSYS_NAME,
30203020
.transport = uri->protocol,
30213021
.traddr = uri->host,
3022+
.trsvcid = trsvcid,
30223023
.host_traddr = host_traddr,
30233024
.host_iface = NULL,
3024-
.trsvcid = trsvcid,
30253025
};
30263026

30273027
/* Lookup existing discovery controller */
@@ -3224,12 +3224,12 @@ int nvmf_discovery(struct nvme_global_ctx *ctx, struct nvmf_context *fctx,
32243224
}
32253225

32263226
struct fabric_args trcfg = {
3227-
.subsysnqn = fctx->subsysnqn,
3228-
.transport = fctx->transport,
3229-
.traddr = fctx->traddr,
3230-
.host_traddr = fctx->host_traddr,
3231-
.host_iface = fctx->host_iface,
3232-
.trsvcid = fctx->trsvcid,
3227+
.subsysnqn = fctx->subsysnqn,
3228+
.transport = fctx->transport,
3229+
.traddr = fctx->traddr,
3230+
.trsvcid = fctx->trsvcid,
3231+
.host_traddr = fctx->host_traddr,
3232+
.host_iface = fctx->host_iface,
32333233
};
32343234

32353235
if (!c && !force) {
@@ -3301,12 +3301,12 @@ int nvmf_connect(struct nvme_global_ctx *ctx, struct nvmf_context *fctx)
33013301
return err;
33023302

33033303
struct fabric_args trcfg = {
3304-
.subsysnqn = fctx->subsysnqn,
3305-
.transport = fctx->transport,
3306-
.traddr = fctx->traddr,
3307-
.host_traddr = fctx->host_traddr,
3308-
.host_iface = fctx->host_iface,
3309-
.trsvcid = fctx->trsvcid,
3304+
.subsysnqn = fctx->subsysnqn,
3305+
.transport = fctx->transport,
3306+
.traddr = fctx->traddr,
3307+
.trsvcid = fctx->trsvcid,
3308+
.host_traddr = fctx->host_traddr,
3309+
.host_iface = fctx->host_iface,
33103310
};
33113311

33123312
c = lookup_ctrl(h, &trcfg);

libnvme/src/nvme/private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ struct fabric_args {
376376
const char *subsysnqn;
377377
const char *transport;
378378
const char *traddr;
379+
const char *trsvcid;
379380
const char *host_traddr;
380381
const char *host_iface;
381-
const char *trsvcid;
382382
};
383383

384384
int nvme_set_attr(const char *dir, const char *attr, const char *value);

0 commit comments

Comments
 (0)