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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user