public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: zkabelac@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2 daemons/clvmd/clvmd-command.c lib/cache/l ...
Date: Thu, 23 Feb 2012 22:23:00 -0000	[thread overview]
Message-ID: <20120223222314.4629.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-23 22:23:13

Modified files:
	daemons/clvmd  : clvmd-command.c 
	lib/cache      : lvmcache.c 

Log message:
	Remaing code suffling
	
	Move declaration to the front of function to follow coding rules.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.127&r2=1.128

--- LVM2/daemons/clvmd/clvmd-command.c	2012/01/25 22:20:11	1.64
+++ LVM2/daemons/clvmd/clvmd-command.c	2012/02/23 22:23:12	1.65
@@ -341,23 +341,25 @@
 /* Called when the client is about to be deleted */
 void cmd_client_cleanup(struct local_client *client)
 {
-    if (client->bits.localsock.private) {
-
 	struct dm_hash_node *v;
-	struct dm_hash_table *lock_hash =
-	    (struct dm_hash_table *)client->bits.localsock.private;
+	struct dm_hash_table *lock_hash;
+	int lkid;
+	char *lockname;
 
-	dm_hash_iterate(v, lock_hash) {
-		int lkid = (int)(long)dm_hash_get_data(lock_hash, v);
-		char *lockname = dm_hash_get_key(lock_hash, v);
+	if (!client->bits.localsock.private)
+		return;
 
+	lock_hash = (struct dm_hash_table *)client->bits.localsock.private;
+
+	dm_hash_iterate(v, lock_hash) {
+		lkid = (int)(long)dm_hash_get_data(lock_hash, v);
+		lockname = dm_hash_get_key(lock_hash, v);
 		DEBUGLOG("cleanup: Unlocking lock %s %x\n", lockname, lkid);
 		sync_unlock(lockname, lkid);
 	}
 
 	dm_hash_destroy(lock_hash);
 	client->bits.localsock.private = 0;
-    }
 }
 
 
--- LVM2/lib/cache/lvmcache.c	2012/02/23 13:11:08	1.127
+++ LVM2/lib/cache/lvmcache.c	2012/02/23 22:23:13	1.128
@@ -452,6 +452,8 @@
 	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 @@
 			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;
 		}


                 reply	other threads:[~2012-02-23 22:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120223222314.4629.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).