sock: sock_map_lookup now takes map as first parameter
Signed-off-by: Ben Walker <benjamin.walker@intel.com> Change-Id: Id294ed4b25352735309bf04e83d09eb455c1b8cb Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7216 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
706c81e21f
commit
b18fdef111
@ -135,14 +135,14 @@ sock_map_release(struct spdk_sock_map *map, int placement_id)
|
|||||||
|
|
||||||
/* Look up the group for a placement_id. */
|
/* Look up the group for a placement_id. */
|
||||||
static int
|
static int
|
||||||
sock_map_lookup(int placement_id, struct spdk_sock_group **group)
|
sock_map_lookup(struct spdk_sock_map *map, int placement_id, struct spdk_sock_group **group)
|
||||||
{
|
{
|
||||||
struct spdk_sock_placement_id_entry *entry;
|
struct spdk_sock_placement_id_entry *entry;
|
||||||
int rc = -EINVAL;
|
int rc = -EINVAL;
|
||||||
|
|
||||||
*group = NULL;
|
*group = NULL;
|
||||||
pthread_mutex_lock(&g_map.mtx);
|
pthread_mutex_lock(&map->mtx);
|
||||||
STAILQ_FOREACH(entry, &g_map.entries, link) {
|
STAILQ_FOREACH(entry, &map->entries, link) {
|
||||||
if (placement_id == entry->placement_id) {
|
if (placement_id == entry->placement_id) {
|
||||||
assert(entry->group != NULL);
|
assert(entry->group != NULL);
|
||||||
*group = entry->group;
|
*group = entry->group;
|
||||||
@ -150,7 +150,7 @@ sock_map_lookup(int placement_id, struct spdk_sock_group **group)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&g_map.mtx);
|
pthread_mutex_unlock(&map->mtx);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ spdk_sock_get_optimal_sock_group(struct spdk_sock *sock, struct spdk_sock_group
|
|||||||
|
|
||||||
placement_id = sock_get_placement_id(sock);
|
placement_id = sock_get_placement_id(sock);
|
||||||
if (placement_id != -1) {
|
if (placement_id != -1) {
|
||||||
sock_map_lookup(placement_id, group);
|
sock_map_lookup(&g_map, placement_id, group);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user