1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-02 04:22:02 +03:00

label: Track a device pointer in struct label.

This commit is contained in:
Petr Rockai
2013-07-29 19:03:20 +02:00
parent dc3a071145
commit cc633c84cf
2 changed files with 4 additions and 1 deletions

View File

@ -282,8 +282,10 @@ int label_read(struct device *dev, struct label **result,
if (!(l = _find_labeller(dev, buf, &sector, scan_sector)))
goto out;
if ((r = (l->ops->read)(l, dev, buf, result)) && result && *result)
if ((r = (l->ops->read)(l, dev, buf, result)) && result && *result) {
(*result)->dev = dev;
(*result)->sector = sector;
}
out:
if (!dev_close(dev))

View File

@ -42,6 +42,7 @@ struct label {
char type[8];
uint64_t sector;
struct labeller *labeller;
struct device *dev;
void *info;
};