Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:FrontRunner
libnvme.26914
0016-tree-simplifiy-nvme_subsystem_lookup_names...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0016-tree-simplifiy-nvme_subsystem_lookup_namespace.patch of Package libnvme.26914
From: Hannes Reinecke <hare@suse.de> Date: Fri, 10 Jun 2022 09:48:03 +0200 Subject: tree: simplifiy nvme_subsystem_lookup_namespace() Git-commit: 5b5acce352a65ce9d8acd04f01b88732bd2daa2d References: git-fixes The list of namespaces needs to be considered static, and should only be changed on a full rescan. So simplify the function to just return the corresponding namespace entry from the topology tree. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Daniel Wagner <dwagner@suse.de> --- src/nvme/tree.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) --- a/src/nvme/tree.c +++ b/src/nvme/tree.c @@ -1933,22 +1933,11 @@ static int nvme_subsystem_scan_namespace struct nvme_ns *nvme_subsystem_lookup_namespace(struct nvme_subsystem *s, __u32 nsid) { - nvme_root_t r = s->h ? s->h->r : NULL; struct nvme_ns *n; - char *name; - int ret; - ret = asprintf(&name, "%sn%u", s->name, nsid); - if (ret < 0) - return NULL; - n = __nvme_scan_namespace(s->sysfs_dir, name); - free(name); - if (!n) { - nvme_msg(r, LOG_DEBUG, "failed to scan namespace %d\n", nsid); - return NULL; + nvme_subsystem_for_each_ns(s, n) { + if (nvme_ns_get_nsid(n) == nsid) + return n; } - - n->s = s; - list_add(&s->namespaces, &n->entry); - return n; + return NULL; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor