summaryrefslogtreecommitdiff
path: root/lib/snapshot
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2014-04-29 23:41:17 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2014-04-30 10:26:30 +0200
commit94018279190d8f2d795a77482f3977f76687289b (patch)
treec891975259ac2b516b80c3a083aaa03e879441e2 /lib/snapshot
parent62e8dd4f6ec73b6f94f66c3b14cdf3d80c06a2af (diff)
downloadlvm2-94018279190d8f2d795a77482f3977f76687289b.tar.gz
cleanup: modules_needed only for devmapper
Drop compilation of modules_needed and add_target_lin function when compiled without devmapper support. Cleanup surrounding ifdefs.
Diffstat (limited to 'lib/snapshot')
-rw-r--r--lib/snapshot/snapshot.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c
index 7ee0365b7..a4ee2eadd 100644
--- a/lib/snapshot/snapshot.c
+++ b/lib/snapshot/snapshot.c
@@ -100,12 +100,12 @@ static int _snap_text_export(const struct lv_segment *seg, struct formatter *f)
return 1;
}
+#ifdef DEVMAPPER_SUPPORT
static int _snap_target_status_compatible(const char *type)
{
return (strcmp(type, "snapshot-merge") == 0);
}
-#ifdef DEVMAPPER_SUPPORT
static int _snap_target_percent(void **target_state __attribute__((unused)),
percent_t *percent,
struct dm_pool *mem __attribute__((unused)),
@@ -178,7 +178,7 @@ static int _snap_target_present(struct cmd_context *cmd,
return _snap_present;
}
-#ifdef DMEVENTD
+# ifdef DMEVENTD
static const char *_get_snapshot_dso_path(struct cmd_context *cmd)
{
@@ -212,8 +212,7 @@ static int _target_unregister_events(struct lv_segment *seg,
return _target_set_events(seg, events, 0);
}
-#endif /* DMEVENTD */
-#endif
+# endif /* DMEVENTD */
static int _snap_modules_needed(struct dm_pool *mem,
const struct lv_segment *seg __attribute__((unused)),
@@ -226,6 +225,7 @@ static int _snap_modules_needed(struct dm_pool *mem,
return 1;
}
+#endif /* DEVMAPPER_SUPPORT */
static void _snap_destroy(struct segment_type *segtype)
{
@@ -237,17 +237,17 @@ static struct segtype_handler _snapshot_ops = {
.target_name = _snap_target_name,
.text_import = _snap_text_import,
.text_export = _snap_text_export,
- .target_status_compatible = _snap_target_status_compatible,
#ifdef DEVMAPPER_SUPPORT
+ .target_status_compatible = _snap_target_status_compatible,
.target_percent = _snap_target_percent,
.target_present = _snap_target_present,
+ .modules_needed = _snap_modules_needed,
# ifdef DMEVENTD
.target_monitored = _target_registered,
.target_monitor_events = _target_register_events,
.target_unmonitor_events = _target_unregister_events,
# endif /* DMEVENTD */
#endif
- .modules_needed = _snap_modules_needed,
.destroy = _snap_destroy,
};