Lines Matching defs:host
3 * NVMe over Fabrics common host code.
26 struct nvmf_host *host;
28 host = kmalloc(sizeof(*host), GFP_KERNEL);
29 if (!host)
32 kref_init(&host->ref);
33 uuid_copy(&host->id, id);
34 strscpy(host->nqn, hostnqn, NVMF_NQN_SIZE);
36 return host;
41 struct nvmf_host *host;
46 * We have defined a host as how it is perceived by the target.
49 * different Host IDs. This'll maintain unambiguous host identification.
51 list_for_each_entry(host, &nvmf_hosts, list) {
52 bool same_hostnqn = !strcmp(host->nqn, hostnqn);
53 bool same_hostid = uuid_equal(&host->id, id);
56 kref_get(&host->ref);
62 host = ERR_PTR(-EINVAL);
68 host = ERR_PTR(-EINVAL);
73 host = nvmf_host_alloc(hostnqn, id);
74 if (!host) {
75 host = ERR_PTR(-ENOMEM);
79 list_add_tail(&host->list, &nvmf_hosts);
82 return host;
87 struct nvmf_host *host;
95 host = nvmf_host_alloc(nqn, &id);
96 if (!host)
100 list_add_tail(&host->list, &nvmf_hosts);
103 return host;
108 struct nvmf_host *host = container_of(ref, struct nvmf_host, ref);
111 list_del(&host->list);
114 kfree(host);
117 static void nvmf_host_put(struct nvmf_host *host)
119 if (host)
120 kref_put(&host->ref, nvmf_host_destroy);
160 * Used by the host system to retrieve a 32-bit capsule property value
205 * Used by the host system to retrieve a 64-bit capsule property value
250 * Used by the NVMe host system to write a 32-bit capsule property value
364 "Connect command failed: host path error\n");
387 uuid_copy(&data->hostid, &ctrl->opts->host->id);
390 strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE);
425 * This function enables an NVMe host device to request a new allocation of
428 * host system device and the allocated NVMe controller on the
499 * host and target (note qid == 0 is illegal as this is
504 * between the host system device and the allocated NVMe controller
681 /* use default host if not given by user space */
810 if (opts->host) {
812 opts->host->nqn);
987 opts->host = nvmf_host_add(hostnqn, &hostid);
988 if (IS_ERR(opts->host)) {
989 ret = PTR_ERR(opts->host);
990 opts->host = NULL;
1104 * Checking the local address or host interfaces is rough.
1106 * In most cases, none is specified and the host port or
1107 * host interface is selected by the stack.
1110 * - local address or host interface is specified and address
1111 * or host interface is not the same
1112 * - local address or host interface is not specified but
1160 nvmf_host_put(opts->host);