1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

device_mapper: use const for this API

Allow using constified version of devs_list.
Internal loop does not need to modify anythin in this stucture.
This commit is contained in:
Zdenek Kabelac 2024-05-24 01:54:48 +02:00
parent 36691b9844
commit 1712845ab5
2 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,7 @@ int dm_task_get_device_list(struct dm_task *dmt, struct dm_list **devs_list,
* 0: uuid not present
* 1: listed and dm_active_device will be set for not NULL pointer
*/
int dm_device_list_find_by_uuid(struct dm_list *devs_list, const char *uuid,
int dm_device_list_find_by_uuid(const struct dm_list *devs_list, const char *uuid,
const struct dm_active_device **dev);
int dm_device_list_find_by_dev(const struct dm_list *devs_list,
uint32_t major, uint32_t minor,

View File

@ -917,11 +917,11 @@ int dm_task_get_device_list(struct dm_task *dmt, struct dm_list **devs_list,
return 1;
}
int dm_device_list_find_by_uuid(struct dm_list *devs_list, const char *uuid,
int dm_device_list_find_by_uuid(const struct dm_list *devs_list, const char *uuid,
const struct dm_active_device **dev)
{
struct dm_device_list *devs = (struct dm_device_list *) devs_list;
struct dm_active_device *dm_dev;
const struct dm_device_list *devs = (const struct dm_device_list *) devs_list;
const struct dm_active_device *dm_dev;
if (devs->uuids &&
(dm_dev = dm_hash_lookup(devs->uuids, uuid))) {