summaryrefslogtreecommitdiffstats
path: root/lib/cache/lvmcache.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-02-23 22:23:12 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2012-02-23 22:23:12 +0000
commitba337a5f3e0576173e19e6d503aa100fa5fad01a (patch)
treeb53fb1ece25571036ac0624646e8ae1b785d8af1 /lib/cache/lvmcache.c
parent9cc66e6f8b922e35dd6ad33cee181b68b5ea5cb3 (diff)
downloadlvm2-ba337a5f3e0576173e19e6d503aa100fa5fad01a.tar.gz
lvm2-ba337a5f3e0576173e19e6d503aa100fa5fad01a.tar.xz
lvm2-ba337a5f3e0576173e19e6d503aa100fa5fad01a.zip
Remaing code suffling
Move declaration to the front of function to follow coding rules.
Diffstat (limited to 'lib/cache/lvmcache.c')
-rw-r--r--lib/cache/lvmcache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 5ea798c2..81753758 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -452,6 +452,8 @@ const struct format_type *lvmcache_fmt_from_vgname(struct cmd_context *cmd,
struct dm_list *devh, *tmp;
struct dm_list devs;
struct device_list *devl;
+ struct volume_group *vg;
+ const struct format_type *fmt;
char vgid_found[ID_LEN + 1] __attribute__((aligned(8)));
if (!(vginfo = lvmcache_vginfo_from_vgname(vgname, vgid))) {
@@ -459,9 +461,8 @@ const struct format_type *lvmcache_fmt_from_vgname(struct cmd_context *cmd,
return NULL; /* too bad */
/* If we don't have the info but we have lvmetad, we can ask
* there before failing. */
- struct volume_group *vg = lvmetad_vg_lookup(cmd, vgname, vgid);
- if (vg) {
- const struct format_type *fmt = vg->fid->fmt;
+ if ((vg = lvmetad_vg_lookup(cmd, vgname, vgid))) {
+ fmt = vg->fid->fmt;
release_vg(vg);
return fmt;
}