slotmap: Add slotmap_get_id() function to get numeric ID of slot map
Change-Id: Ie476244d9ade30eed9215923275aa82a5d10176f
This commit is contained in:
parent
2bf39e0fe0
commit
c86568359c
|
@ -29,6 +29,10 @@ const char *slotmap_name(char *buf, size_t buf_len, const struct slot_mapping *m
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t slotmap_get_id(const struct slot_mapping *map)
|
||||||
|
{
|
||||||
|
return (map->bank.bank_id << 16) | map->bank.slot_nr;
|
||||||
|
}
|
||||||
|
|
||||||
/* thread-safe lookup of map by client:slot */
|
/* thread-safe lookup of map by client:slot */
|
||||||
struct slot_mapping *slotmap_by_client(struct slotmaps *maps, const struct client_slot *client)
|
struct slot_mapping *slotmap_by_client(struct slotmaps *maps, const struct client_slot *client)
|
||||||
|
|
|
@ -68,6 +68,8 @@ struct slotmaps {
|
||||||
pthread_rwlock_t rwlock;
|
pthread_rwlock_t rwlock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint32_t slotmap_get_id(const struct slot_mapping *map);
|
||||||
|
|
||||||
/* thread-safe lookup of map by client:slot */
|
/* thread-safe lookup of map by client:slot */
|
||||||
struct slot_mapping *slotmap_by_client(struct slotmaps *maps, const struct client_slot *client);
|
struct slot_mapping *slotmap_by_client(struct slotmaps *maps, const struct client_slot *client);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue