1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-15 19:33:17 +03:00

labeller: Make the use of "private" as "fmt" explicit.

All labellers always use the "private" (void *) field as the fmt pointer. Making
this fact explicit in the type of the labeller simplifies the label reporting
code which needs to extract the format. Moreover, it removes a number of
error-prone casts from the code.
This commit is contained in:
Petr Rockai
2013-07-29 15:58:18 +02:00
parent bead8ef5f0
commit 9b91977f4e
9 changed files with 13 additions and 13 deletions

View File

@@ -76,11 +76,11 @@ void label_exit(void)
dm_list_init(&_labellers);
}
int label_register_handler(const char *name, struct labeller *handler)
int label_register_handler(struct labeller *handler)
{
struct labeller_i *li;
if (!(li = _alloc_li(name, handler)))
if (!(li = _alloc_li(handler->fmt->name, handler)))
return_0;
dm_list_add(&_labellers, &li->list);