Skip to content

Commit 6da12d0

Browse files
committed
fabrics: move nvmf_default_config to tree
The fabrics configuration data struct is always present, even the fabrics code is disabled. Thus the struct needs always to be initialized Signed-off-by: Daniel Wagner <[email protected]>
1 parent c4ab47f commit 6da12d0

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,6 @@ static const struct nvme_fabric_options default_supported_options = {
338338
.trsvcid = true,
339339
};
340340

341-
void nvmf_default_config(struct nvme_fabrics_config *cfg)
342-
{
343-
memset(cfg, 0, sizeof(*cfg));
344-
cfg->tos = -1;
345-
cfg->ctrl_loss_tmo = NVMF_DEF_CTRL_LOSS_TMO;
346-
}
347-
348341
#define MERGE_CFG_OPTION(c, n, o, d) \
349342
if ((c)->o == d) (c)->o = (n)->o
350343
static struct nvme_fabrics_config *merge_config(nvme_ctrl_t c,

libnvme/src/nvme/tree.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,13 @@ static bool traddr_is_hostname(const char *transport, const char *traddr)
11181118
return true;
11191119
}
11201120

1121+
void nvmf_default_config(struct nvme_fabrics_config *cfg)
1122+
{
1123+
memset(cfg, 0, sizeof(*cfg));
1124+
cfg->tos = -1;
1125+
cfg->ctrl_loss_tmo = NVMF_DEF_CTRL_LOSS_TMO;
1126+
}
1127+
11211128
int nvme_create_ctrl(struct nvme_global_ctx *ctx,
11221129
const char *subsysnqn, const char *transport,
11231130
const char *traddr, const char *host_traddr,

0 commit comments

Comments
 (0)