1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Remove a duplicate disk read (can_handle).

This commit is contained in:
Alasdair Kergon 2002-01-16 13:09:26 +00:00
parent d738054256
commit 3c06874035
2 changed files with 11 additions and 9 deletions

View File

@ -73,7 +73,7 @@ static int _read(struct labeller *l,
int r = 0; int r = 0;
if (!(dl = read_disk(dev, mem, NULL))) { if (!(dl = read_disk(dev, mem, NULL))) {
log_err("Couldn't read lvm1 label."); stack;
return 0; return 0;
} }

View File

@ -120,18 +120,20 @@ int label_remove(struct device *dev)
int label_read(struct device *dev, struct label **result) int label_read(struct device *dev, struct label **result)
{ {
struct labeller *l;
int r; int r;
struct list *lih;
struct labeller_i *li;
if (!(l = _find_labeller(dev))) { list_iterate (lih, &_labellers) {
stack; li = list_item(lih, struct labeller_i);
return 0; if ((r = li->l->ops->read(li->l, dev, result))) {
(*result)->labeller = li->l;
return r;
}
} }
if ((r = l->ops->read(l, dev, result))) log_debug("No label on device '%s'.", dev_name(dev));
(*result)->labeller = l; return 0;
return r;
} }
int label_verify(struct device *dev) int label_verify(struct device *dev)