All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@fedoraproject.org>
To: lvm-devel@redhat.com
Subject: master - fix: also make commit b4637 work without dmeventd
Date: Mon, 30 Sep 2013 06:20:01 +0000 (UTC)	[thread overview]
Message-ID: <20130930062001.8026161007@fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e02ff3226021ddaf0861f65637d9be65d855506b
Commit:        e02ff3226021ddaf0861f65637d9be65d855506b
Parent:        e4c7236c07056ddc9af3ba6ad2314d649d6814f9
Author:        Peter Rajnoha <prajnoha@redhat.com>
AuthorDate:    Mon Sep 30 08:17:56 2013 +0200
Committer:     Peter Rajnoha <prajnoha@redhat.com>
CommitterDate: Mon Sep 30 08:17:56 2013 +0200

fix: also make commit b4637 work without dmeventd

---
 lib/raid/raid.c |   44 ++++++++++++++++++++++----------------------
 lib/thin/thin.c |   53 +++++++++++++++++++++++++++--------------------------
 2 files changed, 49 insertions(+), 48 deletions(-)

diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 20e8c1a..c963fd2 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -282,28 +282,6 @@ static void _raid_destroy(struct segment_type *segtype)
 }
 
 #ifdef DEVMAPPER_SUPPORT
-#ifdef DMEVENTD
-static const char *_get_raid_dso_path(struct cmd_context *cmd)
-{
-	const char *config_str = find_config_tree_str(cmd, dmeventd_raid_library_CFG, NULL);
-	return get_monitor_dso_path(cmd, config_str);
-}
-
-static int _raid_target_present(struct cmd_context *cmd,
-				const struct lv_segment *seg __attribute__((unused)),
-				unsigned *attributes __attribute__((unused)))
-{
-	static int _raid_checked = 0;
-	static int _raid_present = 0;
-
-	if (!_raid_checked)
-		_raid_present = target_present(cmd, "raid", 1);
-
-	_raid_checked = 1;
-
-	return _raid_present;
-}
-
 static int _raid_target_percent(void **target_state,
 				percent_t *percent,
 				struct dm_pool *mem,
@@ -346,6 +324,28 @@ static int _raid_target_percent(void **target_state,
 	return 1;
 }
 
+static int _raid_target_present(struct cmd_context *cmd,
+				const struct lv_segment *seg __attribute__((unused)),
+				unsigned *attributes __attribute__((unused)))
+{
+	static int _raid_checked = 0;
+	static int _raid_present = 0;
+
+	if (!_raid_checked)
+		_raid_present = target_present(cmd, "raid", 1);
+
+	_raid_checked = 1;
+
+	return _raid_present;
+}
+
+#ifdef DMEVENTD
+static const char *_get_raid_dso_path(struct cmd_context *cmd)
+{
+	const char *config_str = find_config_tree_str(cmd, dmeventd_raid_library_CFG, NULL);
+	return get_monitor_dso_path(cmd, config_str);
+}
+
 static int _raid_target_monitored(struct lv_segment *seg, int *pending)
 {
 	struct cmd_context *cmd = seg->lv->vg->cmd;
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 531e546..8477aac 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -224,6 +224,33 @@ static int _thin_target_present(struct cmd_context *cmd,
 				const struct lv_segment *seg,
 				unsigned *attributes);
 
+static int _thin_pool_modules_needed(struct dm_pool *mem,
+				     const struct lv_segment *seg __attribute__((unused)),
+				     struct dm_list *modules)
+{
+	if (!str_list_add(mem, modules, _thin_pool_module)) {
+		log_error("String list allocation failed for thin_pool.");
+		return 0;
+	}
+
+	return 1;
+}
+
+static int _thin_modules_needed(struct dm_pool *mem,
+				const struct lv_segment *seg,
+				struct dm_list *modules)
+{
+	if (!_thin_pool_modules_needed(mem, seg, modules))
+		return_0;
+
+	if (!str_list_add(mem, modules, _thin_module)) {
+		log_error("String list allocation failed for thin.");
+		return 0;
+	}
+
+	return 1;
+}
+
 static int _thin_pool_add_target_line(struct dev_manager *dm,
 				      struct dm_pool *mem,
 				      struct cmd_context *cmd,
@@ -416,32 +443,6 @@ static int _target_unregister_events(struct lv_segment *seg,
 	return _target_set_events(seg, events, 0);
 }
 
-static int _thin_pool_modules_needed(struct dm_pool *mem,
-				     const struct lv_segment *seg __attribute__((unused)),
-				     struct dm_list *modules)
-{
-	if (!str_list_add(mem, modules, _thin_pool_module)) {
-		log_error("String list allocation failed for thin_pool.");
-		return 0;
-	}
-
-	return 1;
-}
-
-static int _thin_modules_needed(struct dm_pool *mem,
-				const struct lv_segment *seg,
-				struct dm_list *modules)
-{
-	if (!_thin_pool_modules_needed(mem, seg, modules))
-		return_0;
-
-	if (!str_list_add(mem, modules, _thin_module)) {
-		log_error("String list allocation failed for thin.");
-		return 0;
-	}
-
-	return 1;
-}
 #  endif /* DMEVENTD */
 #endif /* DEVMAPPER_SUPPORT */
 



                 reply	other threads:[~2013-09-30  6:20 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=20130930062001.8026161007@fedorahosted.org \
    --to=prajnoha@fedoraproject.org \
    --cc=lvm-devel@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.