summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2013-07-29 19:03:20 +0200
committerPetr Rockai <prockai@redhat.com>2013-11-17 21:41:27 +0100
commitcc633c84cfc82e91e83393271a068a662e7d4678 (patch)
tree9294af369983ed707c98fe420ad0b94a7a73b99d
parentdc3a0711454938e1a6264b7e3bf24a6dd1ac7e9f (diff)
downloadlvm2-cc633c84cfc82e91e83393271a068a662e7d4678.tar.gz
label: Track a device pointer in struct label.
-rw-r--r--lib/label/label.c4
-rw-r--r--lib/label/label.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/label/label.c b/lib/label/label.c
index cff64640b..e0831504c 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -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))
diff --git a/lib/label/label.h b/lib/label/label.h
index 8dc49ff46..103e799a8 100644
--- a/lib/label/label.h
+++ b/lib/label/label.h
@@ -42,6 +42,7 @@ struct label {
char type[8];
uint64_t sector;
struct labeller *labeller;
+ struct device *dev;
void *info;
};