Lines Matching refs:host

3  * NVMe over Fabrics common host code.
27 struct nvmf_host *host;
29 host = kmalloc(sizeof(*host), GFP_KERNEL);
30 if (!host)
33 kref_init(&host->ref);
34 uuid_copy(&host->id, id);
35 strscpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
37 return host;
42 struct nvmf_host *host;
47 * We have defined a host as how it is perceived by the target.
50 * different Host IDs. This'll maintain unambiguous host identification.
52 list_for_each_entry(host, &nvmf_hosts, list) {
53 bool same_hostnqn = !strcmp(host->nqn, hostnqn);
54 bool same_hostid = uuid_equal(&host->id, id);
57 kref_get(&host->ref);
63 host = ERR_PTR(-EINVAL);
69 host = ERR_PTR(-EINVAL);
74 host = nvmf_host_alloc(hostnqn, id);
75 if (!host) {
76 host = ERR_PTR(-ENOMEM);
80 list_add_tail(&host->list, &nvmf_hosts);
83 return host;
88 struct nvmf_host *host;
96 host = nvmf_host_alloc(nqn, &id);
97 if (!host)
101 list_add_tail(&host->list, &nvmf_hosts);
104 return host;
109 struct nvmf_host *host = container_of(ref, struct nvmf_host, ref);
112 list_del(&host->list);
115 kfree(host);
118 static void nvmf_host_put(struct nvmf_host *host)
120 if (host)
121 kref_put(&host->ref, nvmf_host_destroy);
161 * Used by the host system to retrieve a 32-bit capsule property value
206 * Used by the host system to retrieve a 64-bit capsule property value
251 * Used by the NVMe host system to write a 32-bit capsule property value
365 "Connect command failed: host path error\n");
388 uuid_copy(&data->hostid, &ctrl->opts->host->id);
391 strscpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE);
426 * This function enables an NVMe host device to request a new allocation of
429 * host system device and the allocated NVMe controller on the
496 * host and target (note qid == 0 is illegal as this is
501 * between the host system device and the allocated NVMe controller
572 * This error code is set on the host side.
728 /* use default host if not given by user space */
857 if (opts->host) {
859 opts->host->nqn);
1068 opts->host = nvmf_host_add(hostnqn, &hostid);
1069 if (IS_ERR(opts->host)) {
1070 ret = PTR_ERR(opts->host);
1071 opts->host = NULL;
1185 * Checking the local address or host interfaces is rough.
1187 * In most cases, none is specified and the host port or
1188 * host interface is selected by the stack.
1191 * - local address or host interface is specified and address
1192 * or host interface is not the same
1193 * - local address or host interface is not specified but
1241 nvmf_host_put(opts->host);
1511 MODULE_DESCRIPTION("NVMe host fabrics library");