mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
dmsetup: add mangled/unmangled_uuid to for info -c
Following the same logic already used for name mangling.
This commit is contained in:
parent
842167eb17
commit
788b7a6a2b
@ -2319,6 +2319,38 @@ static int _dm_uuid_disp(struct dm_report *rh,
|
||||
return dm_report_field_string(rh, field, &uuid);
|
||||
}
|
||||
|
||||
static int _dm_mangled_uuid_disp(struct dm_report *rh,
|
||||
struct dm_pool *mem __attribute__((unused)),
|
||||
struct dm_report_field *field,
|
||||
const void *data, void *private __attribute__((unused)))
|
||||
{
|
||||
char *uuid;
|
||||
int r = 0;
|
||||
|
||||
if ((uuid = dm_task_get_uuid_mangled((const struct dm_task *) data))) {
|
||||
r = dm_report_field_string(rh, field, (const char * const *) &uuid);
|
||||
dm_free(uuid);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int _dm_unmangled_uuid_disp(struct dm_report *rh,
|
||||
struct dm_pool *mem __attribute__((unused)),
|
||||
struct dm_report_field *field,
|
||||
const void *data, void *private __attribute__((unused)))
|
||||
{
|
||||
char *uuid;
|
||||
int r = 0;
|
||||
|
||||
if ((uuid = dm_task_get_uuid_unmangled((const struct dm_task *) data))) {
|
||||
r = dm_report_field_string(rh, field, (const char * const *) &uuid);
|
||||
dm_free(uuid);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int _dm_read_ahead_disp(struct dm_report *rh,
|
||||
struct dm_pool *mem __attribute__((unused)),
|
||||
struct dm_report_field *field, const void *data,
|
||||
@ -2740,6 +2772,8 @@ FIELD_F(TASK, STR, "Name", 16, dm_name, "name", "Name of mapped device.")
|
||||
FIELD_F(TASK, STR, "MangledName", 16, dm_mangled_name, "mangled_name", "Mangled name of mapped device.")
|
||||
FIELD_F(TASK, STR, "UnmangledName", 16, dm_unmangled_name, "unmangled_name", "Unmangled name of mapped device.")
|
||||
FIELD_F(TASK, STR, "UUID", 32, dm_uuid, "uuid", "Unique (optional) identifier for mapped device.")
|
||||
FIELD_F(TASK, STR, "MangledUUID", 32, dm_mangled_uuid, "mangled_uuid", "Mangled unique (optional) identifier for mapped device.")
|
||||
FIELD_F(TASK, STR, "UnmangledUUID", 32, dm_unmangled_uuid, "unmangled_uuid", "Unmangled unique (optional) identifier for mapped device.")
|
||||
|
||||
/* FIXME Next one should be INFO */
|
||||
FIELD_F(TASK, NUM, "RAhead", 6, dm_read_ahead, "read_ahead", "Read ahead in sectors.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user