]> sourceware.org Git - lvm2.git/commitdiff
fix: also make commit b4637 work without dmeventd
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 30 Sep 2013 06:17:56 +0000 (08:17 +0200)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 30 Sep 2013 06:17:56 +0000 (08:17 +0200)
lib/raid/raid.c
lib/thin/thin.c

index 20e8c1a9abc8d29525d5b53aa3878ca50c47b945..c963fd2cb36179c3918caedc06ee4b8a8feeb1aa 100644 (file)
@@ -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;
index 531e5466cd6ca06c84ca011ff631a717e4a906dd..8477aac93a8fe688d315adc9cc9e960516f4deeb 100644 (file)
@@ -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 */
 
This page took 0.044544 seconds and 5 git commands to generate.