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

o label.c now compiles.

This commit is contained in:
Joe Thornber 2002-01-11 10:43:32 +00:00
parent 391f02b1b5
commit 493656dd3c
3 changed files with 20 additions and 19 deletions

View File

@ -34,6 +34,7 @@ SOURCES=\
format_text/flags.c \ format_text/flags.c \
format_text/format-text.c \ format_text/format-text.c \
format_text/import.c \ format_text/import.c \
label/label.c \
log/log.c \ log/log.c \
metadata/lv_manip.c \ metadata/lv_manip.c \
metadata/merge.c \ metadata/merge.c \

View File

@ -40,7 +40,7 @@ static struct labeller_i *_alloc_li(const char *name, struct labeller *l)
return li; return li;
} }
static void _free_li(struct list *li) static void _free_li(struct labeller_i *li)
{ {
dbg_free(li); dbg_free(li);
} }
@ -55,12 +55,12 @@ int label_init(void)
void label_exit(void) void label_exit(void)
{ {
struct list *c, *n; struct list *c, *n;
struct labeller_list *ll; struct labeller_i *li;
for (c = _labellers.n; c != &_labellers; c = n) { for (c = _labellers.n; c != &_labellers; c = n) {
n = c->n; n = c->n;
ll = list_item(c, struct labeller_list); li = list_item(c, struct labeller_i);
_free_li(c); _free_li(li);
} }
} }
@ -91,55 +91,55 @@ struct labeller *label_get_handler(const char *name)
return NULL; return NULL;
} }
static struct labeller *_find_labeller(const char *device) static struct labeller *_find_labeller(struct device *dev)
{ {
struct list *lih; struct list *lih;
struct labeller_i *li; struct labeller_i *li;
list_iterate (lih, &_labellers) { list_iterate (lih, &_labellers) {
li = list_item(lih, struct labeller_i); li = list_item(lih, struct labeller_i);
if (li->l->ops->can_handle(device)) if (li->l->ops->can_handle(li->l, dev))
return li->l; return li->l;
} }
log_err("Could not find label on device '%s'.", device); log_err("Could not find label on device '%s'.", dev_name(dev));
return NULL; return NULL;
} }
int label_remove(const char *device) int label_remove(struct device *dev)
{ {
struct labeller *l; struct labeller *l;
if (!(l = _find_labeller(device))) { if (!(l = _find_labeller(dev))) {
stack; stack;
return 0; return 0;
} }
return l->ops->remove(device); return l->ops->remove(l, dev);
} }
int label_read(const char *path, struct label **result) int label_read(struct device *dev, struct label **result)
{ {
struct labeller *l; struct labeller *l;
if (!(l = _find_labeller(device))) { if (!(l = _find_labeller(dev))) {
stack; stack;
return 0; return 0;
} }
return l->ops->read(device, label); return l->ops->read(l, dev, result);
} }
int label_verify(const char *path) int label_verify(struct device *dev)
{ {
struct labeller *l; struct labeller *l;
if (!(l = _find_labeller(device))) { if (!(l = _find_labeller(dev))) {
stack; stack;
return 0; return 0;
} }
return l->ops->verify(device); return l->ops->verify(l, dev);
} }
void label_free(struct label *l) void label_free(struct label *l)

View File

@ -69,9 +69,9 @@ int label_register_handler(const char *name, struct labeller *handler);
struct labeller *label_get_handler(const char *name); struct labeller *label_get_handler(const char *name);
int label_remove(const char *path); int label_remove(struct device *dev);
int label_read(const char *path, struct label **result); int label_read(struct device *dev, struct label **result);
int label_verify(const char *path); int label_verify(struct device *dev);
void label_free(struct label *l); void label_free(struct label *l);
/* /*