1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-30 10:50:34 +03:00

Fix !DEVMAPPER_SUPPORT build

Fix build when devmapper is disabled.
This commit is contained in:
Zdenek Kabelac 2011-02-18 14:29:39 +00:00
parent b11dd1f7b3
commit c0a8ab7699
4 changed files with 35 additions and 15 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.85 -
===================================
Fix compilation when devmapper is dissabled.
Remove fs_unlock() from lv_suspend error path.
Change memory locking semantic and use critical sections.
Add configurable pv_min_size to select block devices by its size.

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
* Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@ -171,7 +171,7 @@ int lvs_in_vg_activated(struct volume_group *vg)
{
return 0;
}
int lvs_in_vg_opened(struct volume_group *vg)
int lvs_in_vg_opened(const struct volume_group *vg)
{
return 0;
}
@ -181,15 +181,16 @@ int lv_suspend(struct cmd_context *cmd, const char *lvid_s)
return 1;
}
*******/
int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s)
int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only)
{
return 1;
}
int lv_resume(struct cmd_context *cmd, const char *lvid_s)
int lv_resume(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only)
{
return 1;
}
int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s)
int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s,
unsigned origin_only, unsigned exclusive)
{
return 1;
}
@ -210,28 +211,42 @@ int lv_activate_with_filter(struct cmd_context *cmd, const char *lvid_s, int exc
{
return 1;
}
int lv_mknodes(struct cmd_context *cmd, const struct logical_volume *lv)
{
return 1;
}
int pv_uses_vg(struct physical_volume *pv,
struct volume_group *vg)
{
return 0;
}
void activation_release(void)
{
return;
}
void activation_exit(void)
{
return;
}
int lv_is_active(struct logical_volume *lv)
{
return 0;
}
int lv_is_active_exclusive_locally(struct logical_volume *lv)
{
return 0;
}
int lv_is_active_exclusive_remotely(struct logical_volume *lv)
{
return 0;
}
int lv_check_transient(struct logical_volume *lv)
{
return 1;
}
int monitor_dev_for_events(struct cmd_context *cmd, struct logical_volume *lv,
unsigned origin_only, int monitor)
{
return 1;
}
#else /* DEVMAPPER_SUPPORT */
static int _activation = 1;

View File

@ -30,9 +30,6 @@
#include <sys/utsname.h>
static int _block_on_error_available = 0;
static unsigned _mirror_attributes = 0;
enum {
MIRR_DISABLED,
MIRR_RUNNING,
@ -158,6 +155,9 @@ static int _mirrored_text_export(const struct lv_segment *seg, struct formatter
}
#ifdef DEVMAPPER_SUPPORT
static int _block_on_error_available = 0;
static unsigned _mirror_attributes = 0;
static struct mirror_state *_mirrored_init_target(struct dm_pool *mem,
struct cmd_context *cmd)
{
@ -641,9 +641,11 @@ struct segment_type *init_segtype(struct cmd_context *cmd)
segtype->private = NULL;
segtype->flags = SEG_AREAS_MIRRORED;
#ifdef DEVMAPPER_SUPPORT
#ifdef DMEVENTD
if (_get_mirror_dso_path(cmd))
segtype->flags |= SEG_MONITORED;
#endif
#endif
log_very_verbose("Initialised segtype: %s", segtype->name);

View File

@ -260,9 +260,11 @@ struct segment_type *init_segtype(struct cmd_context *cmd)
segtype->private = NULL;
segtype->flags = SEG_SNAPSHOT;
#ifdef DEVMAPPER_SUPPORT
#ifdef DMEVENTD
if (_get_snapshot_dso_path(cmd))
segtype->flags |= SEG_MONITORED;
#endif
#endif
log_very_verbose("Initialised segtype: %s", segtype->name);