mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Some whitespace tidy-ups.
This commit is contained in:
parent
c51b9fff19
commit
67cdbd7e4d
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.33 -
|
Version 2.02.33 -
|
||||||
===================================
|
===================================
|
||||||
|
Some whitespace tidy-ups.
|
||||||
Use stack return macros throughout.
|
Use stack return macros throughout.
|
||||||
Rely upon internally-cached PV labels while corresponding VG lock is held.
|
Rely upon internally-cached PV labels while corresponding VG lock is held.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -156,9 +156,9 @@ int device_is_usable(dev_t dev)
|
|||||||
struct dm_task *dmt;
|
struct dm_task *dmt;
|
||||||
struct dm_info info;
|
struct dm_info info;
|
||||||
const char *name;
|
const char *name;
|
||||||
uint64_t start, length;
|
uint64_t start, length;
|
||||||
char *target_type = NULL;
|
char *target_type = NULL;
|
||||||
char *params;
|
char *params;
|
||||||
void *next = NULL;
|
void *next = NULL;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
@ -186,13 +186,13 @@ int device_is_usable(dev_t dev)
|
|||||||
/* FIXME Also check for mirror block_on_error and mpath no paths */
|
/* FIXME Also check for mirror block_on_error and mpath no paths */
|
||||||
/* For now, we exclude all mirrors */
|
/* For now, we exclude all mirrors */
|
||||||
|
|
||||||
do {
|
do {
|
||||||
next = dm_get_next_target(dmt, next, &start, &length,
|
next = dm_get_next_target(dmt, next, &start, &length,
|
||||||
&target_type, ¶ms);
|
&target_type, ¶ms);
|
||||||
/* Skip if target type doesn't match */
|
/* Skip if target type doesn't match */
|
||||||
if (target_type && !strcmp(target_type, "mirror"))
|
if (target_type && !strcmp(target_type, "mirror"))
|
||||||
goto out;
|
goto out;
|
||||||
} while (next);
|
} while (next);
|
||||||
|
|
||||||
/* FIXME Also check dependencies? */
|
/* FIXME Also check dependencies? */
|
||||||
|
|
||||||
@ -629,11 +629,11 @@ static int _add_dev_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
|
|||||||
if (!(dlid = build_dlid(dm, lv->lvid.s, layer)))
|
if (!(dlid = build_dlid(dm, lv->lvid.s, layer)))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
log_debug("Getting device info for %s [%s]", name, dlid);
|
log_debug("Getting device info for %s [%s]", name, dlid);
|
||||||
if (!_info(name, dlid, 0, 1, 0, &info, NULL)) {
|
if (!_info(name, dlid, 0, 1, 0, &info, NULL)) {
|
||||||
log_error("Failed to get info for %s [%s].", name, dlid);
|
log_error("Failed to get info for %s [%s].", name, dlid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.exists && !dm_tree_add_dev(dtree, info.major, info.minor)) {
|
if (info.exists && !dm_tree_add_dev(dtree, info.major, info.minor)) {
|
||||||
log_error("Failed to add device (%" PRIu32 ":%" PRIu32") to dtree",
|
log_error("Failed to add device (%" PRIu32 ":%" PRIu32") to dtree",
|
||||||
@ -967,10 +967,10 @@ static int _create_lv_symlinks(struct dev_manager *dm, struct dm_tree_node *root
|
|||||||
name = dm_tree_node_get_name(child);
|
name = dm_tree_node_get_name(child);
|
||||||
|
|
||||||
if (name && lvlayer->old_name && *lvlayer->old_name && strcmp(name, lvlayer->old_name)) {
|
if (name && lvlayer->old_name && *lvlayer->old_name && strcmp(name, lvlayer->old_name)) {
|
||||||
if (!dm_split_lvm_name(dm->mem, lvlayer->old_name, &vgname, &lvname, &layer)) {
|
if (!dm_split_lvm_name(dm->mem, lvlayer->old_name, &vgname, &lvname, &layer)) {
|
||||||
log_error("_create_lv_symlinks: Couldn't split up old device name %s", lvlayer->old_name);
|
log_error("_create_lv_symlinks: Couldn't split up old device name %s", lvlayer->old_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
fs_rename_lv(lvlayer->lv, name, lvname);
|
fs_rename_lv(lvlayer->lv, name, lvname);
|
||||||
} else if (!dev_manager_lv_mknodes(lvlayer->lv))
|
} else if (!dev_manager_lv_mknodes(lvlayer->lv))
|
||||||
r = 0;
|
r = 0;
|
||||||
@ -990,7 +990,7 @@ static int _remove_lv_symlinks(struct dev_manager *dm, struct dm_tree_node *root
|
|||||||
int r = 1;
|
int r = 1;
|
||||||
|
|
||||||
while ((child = dm_tree_next_child(&handle, root, 0))) {
|
while ((child = dm_tree_next_child(&handle, root, 0))) {
|
||||||
if (!dm_split_lvm_name(dm->mem, dm_tree_node_get_name(child), &vgname, &lvname, &layer)) {
|
if (!dm_split_lvm_name(dm->mem, dm_tree_node_get_name(child), &vgname, &lvname, &layer)) {
|
||||||
r = 0;
|
r = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1019,10 +1019,10 @@ static int _clean_tree(struct dev_manager *dm, struct dm_tree_node *root)
|
|||||||
if (!(uuid = dm_tree_node_get_uuid(child)))
|
if (!(uuid = dm_tree_node_get_uuid(child)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!dm_split_lvm_name(dm->mem, name, &vgname, &lvname, &layer)) {
|
if (!dm_split_lvm_name(dm->mem, name, &vgname, &lvname, &layer)) {
|
||||||
log_error("_clean_tree: Couldn't split up device name %s.", name);
|
log_error("_clean_tree: Couldn't split up device name %s.", name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not meant to be top level? */
|
/* Not meant to be top level? */
|
||||||
if (!*layer)
|
if (!*layer)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -138,7 +138,7 @@ static int _mk_link(const char *dev_dir, const char *vg_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* To reach this point, the VG must have been locked.
|
/* To reach this point, the VG must have been locked.
|
||||||
* As locking fails if the VG is active under LVM1, it's
|
* As locking fails if the VG is active under LVM1, it's
|
||||||
* now safe to remove any LVM1 devices we find here
|
* now safe to remove any LVM1 devices we find here
|
||||||
* (as well as any existing LVM2 symlink). */
|
* (as well as any existing LVM2 symlink). */
|
||||||
if (!lstat(lvm1_group_path, &buf)) {
|
if (!lstat(lvm1_group_path, &buf)) {
|
||||||
@ -175,8 +175,8 @@ static int _mk_link(const char *dev_dir, const char *vg_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SELINUX
|
#ifdef HAVE_SELINUX
|
||||||
if (!dm_set_selinux_context(lv_path, S_IFLNK))
|
if (!dm_set_selinux_context(lv_path, S_IFLNK))
|
||||||
return_0;
|
return_0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
30
lib/cache/lvmcache.c
vendored
30
lib/cache/lvmcache.c
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -135,7 +135,7 @@ struct lvmcache_vginfo *vginfo_from_vgname(const char *vgname, const char *vgid)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (vgid)
|
if (vgid)
|
||||||
do
|
do
|
||||||
if (!strncmp(vgid, vginfo->vgid, ID_LEN))
|
if (!strncmp(vgid, vginfo->vgid, ID_LEN))
|
||||||
return vginfo;
|
return vginfo;
|
||||||
while ((vginfo = vginfo->next));
|
while ((vginfo = vginfo->next));
|
||||||
@ -335,7 +335,7 @@ struct list *lvmcache_get_vgids(struct cmd_context *cmd, int full_scan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
list_iterate_items(vginfo, &_vginfos) {
|
list_iterate_items(vginfo, &_vginfos) {
|
||||||
if (!str_list_add(cmd->mem, vgids,
|
if (!str_list_add(cmd->mem, vgids,
|
||||||
dm_pool_strdup(cmd->mem, vginfo->vgid))) {
|
dm_pool_strdup(cmd->mem, vginfo->vgid))) {
|
||||||
log_error("strlist allocation failed");
|
log_error("strlist allocation failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -358,7 +358,7 @@ struct list *lvmcache_get_vgnames(struct cmd_context *cmd, int full_scan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
list_iterate_items(vginfo, &_vginfos) {
|
list_iterate_items(vginfo, &_vginfos) {
|
||||||
if (!str_list_add(cmd->mem, vgnames,
|
if (!str_list_add(cmd->mem, vgnames,
|
||||||
dm_pool_strdup(cmd->mem, vginfo->vgname))) {
|
dm_pool_strdup(cmd->mem, vginfo->vgname))) {
|
||||||
log_error("strlist allocation failed");
|
log_error("strlist allocation failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -384,7 +384,7 @@ struct list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname,
|
|||||||
return pvids;
|
return pvids;
|
||||||
|
|
||||||
list_iterate_items(info, &vginfo->infos) {
|
list_iterate_items(info, &vginfo->infos) {
|
||||||
if (!str_list_add(cmd->mem, pvids,
|
if (!str_list_add(cmd->mem, pvids,
|
||||||
dm_pool_strdup(cmd->mem, info->dev->pvid))) {
|
dm_pool_strdup(cmd->mem, info->dev->pvid))) {
|
||||||
log_error("strlist allocation failed");
|
log_error("strlist allocation failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -446,12 +446,12 @@ static int _drop_vginfo(struct lvmcache_info *info)
|
|||||||
if (info->vginfo && list_empty(&info->vginfo->infos)) {
|
if (info->vginfo && list_empty(&info->vginfo->infos)) {
|
||||||
dm_hash_remove(_vgname_hash, info->vginfo->vgname);
|
dm_hash_remove(_vgname_hash, info->vginfo->vgname);
|
||||||
if (info->vginfo->next) {
|
if (info->vginfo->next) {
|
||||||
if (!dm_hash_insert(_vgname_hash, info->vginfo->vgname, info->vginfo->next)) {
|
if (!dm_hash_insert(_vgname_hash, info->vginfo->vgname, info->vginfo->next)) {
|
||||||
log_error("vg hash re-insertion failed: %s",
|
log_error("vg hash re-insertion failed: %s",
|
||||||
info->vginfo->vgname);
|
info->vginfo->vgname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->vginfo->vgname)
|
if (info->vginfo->vgname)
|
||||||
dm_free(info->vginfo->vgname);
|
dm_free(info->vginfo->vgname);
|
||||||
@ -477,7 +477,7 @@ void lvmcache_del(struct lvmcache_info *info)
|
|||||||
_drop_vginfo(info);
|
_drop_vginfo(info);
|
||||||
|
|
||||||
info->label->labeller->ops->destroy_label(info->label->labeller,
|
info->label->labeller->ops->destroy_label(info->label->labeller,
|
||||||
info->label);
|
info->label);
|
||||||
dm_free(info);
|
dm_free(info);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -617,7 +617,7 @@ static int _lvmcache_update_vgname(struct lvmcache_info *info,
|
|||||||
struct lvmcache_vginfo *vginfo, *primary_vginfo;
|
struct lvmcache_vginfo *vginfo, *primary_vginfo;
|
||||||
// struct lvmcache_vginfo *old_vginfo, *next;
|
// struct lvmcache_vginfo *old_vginfo, *next;
|
||||||
|
|
||||||
/* If vgname is NULL and we don't already have a vgname,
|
/* If vgname is NULL and we don't already have a vgname,
|
||||||
* assume ORPHAN - we want every entry to have a vginfo
|
* assume ORPHAN - we want every entry to have a vginfo
|
||||||
* attached for scanning reasons.
|
* attached for scanning reasons.
|
||||||
*/
|
*/
|
||||||
@ -643,9 +643,9 @@ static int _lvmcache_update_vgname(struct lvmcache_info *info,
|
|||||||
dm_hash_remove(_vgname_hash, old_vginfo->vgname);
|
dm_hash_remove(_vgname_hash, old_vginfo->vgname);
|
||||||
if (old_vginfo->next) {
|
if (old_vginfo->next) {
|
||||||
if (!dm_hash_insert(_vgname_hash, old_vginfo->vgname, old_vginfo->next)) {
|
if (!dm_hash_insert(_vgname_hash, old_vginfo->vgname, old_vginfo->next)) {
|
||||||
log_error("vg hash re-insertion failed: %s",
|
log_error("vg hash re-insertion failed: %s",
|
||||||
old_vginfo->vgname);
|
old_vginfo->vgname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else do {
|
} else do {
|
||||||
@ -662,11 +662,11 @@ static int _lvmcache_update_vgname(struct lvmcache_info *info,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rename so can assume new name does not already exist
|
// Rename so can assume new name does not already exist
|
||||||
if (!dm_hash_insert(_vgname_hash, vginfo->vgname, vginfo->next)) {
|
if (!dm_hash_insert(_vgname_hash, vginfo->vgname, vginfo->next)) {
|
||||||
log_error("vg hash re-insertion failed: %s",
|
log_error("vg hash re-insertion failed: %s",
|
||||||
vginfo->vgname);
|
vginfo->vgname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
***/
|
***/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -529,7 +529,7 @@ static struct dev_filter *_init_filter_components(struct cmd_context *cmd)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* sysfs filter. Only available on 2.6 kernels. Non-critical.
|
* sysfs filter. Only available on 2.6 kernels. Non-critical.
|
||||||
* Listed first because it's very efficient at eliminating
|
* Listed first because it's very efficient at eliminating
|
||||||
* unavailable devices.
|
* unavailable devices.
|
||||||
*/
|
*/
|
||||||
if (find_config_tree_bool(cmd, "devices/sysfs_scan",
|
if (find_config_tree_bool(cmd, "devices/sysfs_scan",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -488,7 +488,7 @@ static int _init_preferred_names(struct cmd_context *cmd)
|
|||||||
if (v->type != CFG_STRING) {
|
if (v->type != CFG_STRING) {
|
||||||
log_error("preferred_names patterns must be enclosed in quotes");
|
log_error("preferred_names patterns must be enclosed in quotes");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
@ -336,7 +336,7 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet)
|
|||||||
|
|
||||||
if (dev->open_count && !need_excl) {
|
if (dev->open_count && !need_excl) {
|
||||||
/* FIXME Ensure we never get here */
|
/* FIXME Ensure we never get here */
|
||||||
log_debug("WARNING: %s already opened read-only",
|
log_debug("WARNING: %s already opened read-only",
|
||||||
dev_name(dev));
|
dev_name(dev));
|
||||||
dev->open_count++;
|
dev->open_count++;
|
||||||
}
|
}
|
||||||
@ -516,7 +516,7 @@ static int _dev_close(struct device *dev, int immediate)
|
|||||||
|
|
||||||
/* Close unless device is known to belong to a locked VG */
|
/* Close unless device is known to belong to a locked VG */
|
||||||
if (immediate ||
|
if (immediate ||
|
||||||
(dev->open_count < 1 &&
|
(dev->open_count < 1 &&
|
||||||
(!(info = info_from_pvid(dev->pvid, 0)) ||
|
(!(info = info_from_pvid(dev->pvid, 0)) ||
|
||||||
!info->vginfo ||
|
!info->vginfo ||
|
||||||
!vgname_is_locked(info->vginfo->vgname))))
|
!vgname_is_locked(info->vginfo->vgname))))
|
||||||
|
@ -27,16 +27,16 @@
|
|||||||
#define PART_OFFSET UINT64_C(0x1BE)
|
#define PART_OFFSET UINT64_C(0x1BE)
|
||||||
|
|
||||||
struct partition {
|
struct partition {
|
||||||
uint8_t boot_ind;
|
uint8_t boot_ind;
|
||||||
uint8_t head;
|
uint8_t head;
|
||||||
uint8_t sector;
|
uint8_t sector;
|
||||||
uint8_t cyl;
|
uint8_t cyl;
|
||||||
uint8_t sys_ind; /* partition type */
|
uint8_t sys_ind; /* partition type */
|
||||||
uint8_t end_head;
|
uint8_t end_head;
|
||||||
uint8_t end_sector;
|
uint8_t end_sector;
|
||||||
uint8_t end_cyl;
|
uint8_t end_cyl;
|
||||||
uint32_t start_sect;
|
uint32_t start_sect;
|
||||||
uint32_t nr_sects;
|
uint32_t nr_sects;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
static int _is_partitionable(struct device *dev)
|
static int _is_partitionable(struct device *dev)
|
||||||
|
@ -694,7 +694,7 @@ void vgdisplay_colons(const struct volume_group *vg)
|
|||||||
(uint64_t) vg->extent_count * (vg->extent_size / 2),
|
(uint64_t) vg->extent_count * (vg->extent_size / 2),
|
||||||
vg->extent_size / 2,
|
vg->extent_size / 2,
|
||||||
vg->extent_count,
|
vg->extent_count,
|
||||||
vg->extent_count - vg->free_count,
|
vg->extent_count - vg->free_count,
|
||||||
vg->free_count,
|
vg->free_count,
|
||||||
uuid[0] ? uuid : "none");
|
uuid[0] ? uuid : "none");
|
||||||
return;
|
return;
|
||||||
|
@ -77,7 +77,7 @@ static int _errseg_modules_needed(struct dm_pool *mem,
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _errseg_destroy(const struct segment_type *segtype)
|
static void _errseg_destroy(const struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
dm_free((void *)segtype);
|
dm_free((void *)segtype);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -97,13 +97,13 @@ int persistent_filter_load(struct dev_filter *f, struct config_tree **cft_out)
|
|||||||
{
|
{
|
||||||
struct pfilter *pf = (struct pfilter *) f->private;
|
struct pfilter *pf = (struct pfilter *) f->private;
|
||||||
struct config_tree *cft;
|
struct config_tree *cft;
|
||||||
struct stat info;
|
struct stat info;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
if (!stat(pf->file, &info))
|
if (!stat(pf->file, &info))
|
||||||
pf->ctime = info.st_ctime;
|
pf->ctime = info.st_ctime;
|
||||||
else {
|
else {
|
||||||
log_very_verbose("%s: stat failed: %s", pf->file,
|
log_very_verbose("%s: stat failed: %s", pf->file,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return_0;
|
return_0;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -236,21 +236,21 @@ static int _read_dev(const char *file, dev_t *result)
|
|||||||
*/
|
*/
|
||||||
static int _read_devs(struct dev_set *ds, const char *dir, unsigned sysfs_depth)
|
static int _read_devs(struct dev_set *ds, const char *dir, unsigned sysfs_depth)
|
||||||
{
|
{
|
||||||
struct dirent *d;
|
struct dirent *d;
|
||||||
DIR *dr;
|
DIR *dr;
|
||||||
struct stat info;
|
struct stat info;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
char file[PATH_MAX];
|
char file[PATH_MAX];
|
||||||
dev_t dev = { 0 };
|
dev_t dev = { 0 };
|
||||||
int r = 1;
|
int r = 1;
|
||||||
|
|
||||||
if (!(dr = opendir(dir))) {
|
if (!(dr = opendir(dir))) {
|
||||||
log_sys_error("opendir", dir);
|
log_sys_error("opendir", dir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((d = readdir(dr))) {
|
while ((d = readdir(dr))) {
|
||||||
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
|
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (dm_snprintf(path, sizeof(path), "%s/%s", dir,
|
if (dm_snprintf(path, sizeof(path), "%s/%s", dir,
|
||||||
@ -278,8 +278,8 @@ static int _read_devs(struct dev_set *ds, const char *dir, unsigned sysfs_depth)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closedir(dr))
|
if (closedir(dr))
|
||||||
log_sys_error("closedir", dir);
|
log_sys_error("closedir", dir);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -133,15 +133,15 @@ static int _munge_formats(struct pv_disk *pvd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* UUID too long? */
|
/* UUID too long? */
|
||||||
if (pvd->pv_uuid[ID_LEN]) {
|
if (pvd->pv_uuid[ID_LEN]) {
|
||||||
/* Retain ID_LEN chars from end */
|
/* Retain ID_LEN chars from end */
|
||||||
for (e = ID_LEN; e < sizeof(pvd->pv_uuid); e++) {
|
for (e = ID_LEN; e < sizeof(pvd->pv_uuid); e++) {
|
||||||
if (!pvd->pv_uuid[e]) {
|
if (!pvd->pv_uuid[e]) {
|
||||||
e--;
|
e--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (b = 0; b < ID_LEN; b++) {
|
for (b = 0; b < ID_LEN; b++) {
|
||||||
pvd->pv_uuid[b] = pvd->pv_uuid[++e - ID_LEN];
|
pvd->pv_uuid[b] = pvd->pv_uuid[++e - ID_LEN];
|
||||||
/* FIXME Remove all invalid chars */
|
/* FIXME Remove all invalid chars */
|
||||||
@ -149,7 +149,7 @@ static int _munge_formats(struct pv_disk *pvd)
|
|||||||
pvd->pv_uuid[b] = '#';
|
pvd->pv_uuid[b] = '#';
|
||||||
}
|
}
|
||||||
memset(&pvd->pv_uuid[ID_LEN], 0, sizeof(pvd->pv_uuid) - ID_LEN);
|
memset(&pvd->pv_uuid[ID_LEN], 0, sizeof(pvd->pv_uuid) - ID_LEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If UUID is missing, create one */
|
/* If UUID is missing, create one */
|
||||||
if (pvd->pv_uuid[0] == '\0') {
|
if (pvd->pv_uuid[0] == '\0') {
|
||||||
@ -160,8 +160,8 @@ static int _munge_formats(struct pv_disk *pvd)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If exported, remove "PV_EXP" from end of VG name
|
* If exported, remove "PV_EXP" from end of VG name
|
||||||
*/
|
*/
|
||||||
static void _munge_exported_vg(struct pv_disk *pvd)
|
static void _munge_exported_vg(struct pv_disk *pvd)
|
||||||
{
|
{
|
||||||
@ -177,8 +177,8 @@ static void _munge_exported_vg(struct pv_disk *pvd)
|
|||||||
s = sizeof(EXPORTED_TAG);
|
s = sizeof(EXPORTED_TAG);
|
||||||
if (!strncmp((char *)pvd->vg_name + l - s + 1, EXPORTED_TAG, s)) {
|
if (!strncmp((char *)pvd->vg_name + l - s + 1, EXPORTED_TAG, s)) {
|
||||||
pvd->vg_name[l - s + 1] = '\0';
|
pvd->vg_name[l - s + 1] = '\0';
|
||||||
pvd->pv_status |= VG_EXPORTED;
|
pvd->pv_status |= VG_EXPORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int munge_pvd(struct device *dev, struct pv_disk *pvd)
|
int munge_pvd(struct device *dev, struct pv_disk *pvd)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -444,7 +444,7 @@ static int _format1_vg_setup(struct format_instance *fid, struct volume_group *v
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)),
|
static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)),
|
||||||
const struct segment_type *segtype)
|
const struct segment_type *segtype)
|
||||||
{
|
{
|
||||||
if (!(segtype->flags & SEG_FORMAT1_SUPPORT))
|
if (!(segtype->flags & SEG_FORMAT1_SUPPORT))
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -618,7 +618,7 @@ int import_snapshots(struct dm_pool *mem __attribute((unused)), struct volume_gr
|
|||||||
|
|
||||||
/* insert the snapshot */
|
/* insert the snapshot */
|
||||||
if (!vg_add_snapshot(NULL, org, cow, NULL,
|
if (!vg_add_snapshot(NULL, org, cow, NULL,
|
||||||
org->le_count,
|
org->le_count,
|
||||||
lvd->lv_chunk_size)) {
|
lvd->lv_chunk_size)) {
|
||||||
log_err("Couldn't add snapshot.");
|
log_err("Couldn't add snapshot.");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -280,7 +280,7 @@ static int _read_stripes(struct cmd_context *cmd, struct lv_map *lvm)
|
|||||||
while (first_area_le < total_area_len) {
|
while (first_area_le < total_area_len) {
|
||||||
area_len = 1;
|
area_len = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find how many extents are contiguous in all stripes
|
* Find how many extents are contiguous in all stripes
|
||||||
* and so can form part of this segment
|
* and so can form part of this segment
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -215,7 +215,7 @@ static int _add_stripe_seg(struct dm_pool *mem,
|
|||||||
"striped")))
|
"striped")))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
if (!(seg = alloc_lv_segment(mem, segtype, lv, *le_cur,
|
if (!(seg = alloc_lv_segment(mem, segtype, lv, *le_cur,
|
||||||
area_len * usp->num_devs, 0,
|
area_len * usp->num_devs, 0,
|
||||||
usp->striping, NULL, usp->num_devs,
|
usp->striping, NULL, usp->num_devs,
|
||||||
area_len, 0, 0, 0))) {
|
area_len, 0, 0, 0))) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 1997-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -115,9 +115,9 @@ int archive(struct volume_group *vg)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Trap a read-only file system */
|
/* Trap a read-only file system */
|
||||||
if ((access(vg->cmd->archive_params->dir, R_OK | W_OK | X_OK) == -1) &&
|
if ((access(vg->cmd->archive_params->dir, R_OK | W_OK | X_OK) == -1) &&
|
||||||
(errno == EROFS))
|
(errno == EROFS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log_verbose("Archiving volume group \"%s\" metadata (seqno %u).", vg->name,
|
log_verbose("Archiving volume group \"%s\" metadata (seqno %u).", vg->name,
|
||||||
vg->seqno);
|
vg->seqno);
|
||||||
@ -219,9 +219,9 @@ int backup(struct volume_group *vg)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Trap a read-only file system */
|
/* Trap a read-only file system */
|
||||||
if ((access(vg->cmd->backup_params->dir, R_OK | W_OK | X_OK) == -1) &&
|
if ((access(vg->cmd->backup_params->dir, R_OK | W_OK | X_OK) == -1) &&
|
||||||
(errno == EROFS))
|
(errno == EROFS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!__backup(vg)) {
|
if (!__backup(vg)) {
|
||||||
log_error("Backup of volume group %s metadata failed.",
|
log_error("Backup of volume group %s metadata failed.",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -37,7 +37,7 @@ typedef int (*nl_fn) (struct formatter * f);
|
|||||||
* Then argument list is reset and out_with_comment_fn is called again.
|
* Then argument list is reset and out_with_comment_fn is called again.
|
||||||
*/
|
*/
|
||||||
#define _out_with_comment(f, buffer, fmt, ap) \
|
#define _out_with_comment(f, buffer, fmt, ap) \
|
||||||
do { \
|
do { \
|
||||||
va_start(ap, fmt); \
|
va_start(ap, fmt); \
|
||||||
r = f->out_with_comment(f, buffer, fmt, ap); \
|
r = f->out_with_comment(f, buffer, fmt, ap); \
|
||||||
va_end(ap); \
|
va_end(ap); \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -250,7 +250,7 @@ static int _pv_analyze_mda_raw (const struct format_type * fmt,
|
|||||||
static int _text_lv_setup(struct format_instance *fid __attribute((unused)),
|
static int _text_lv_setup(struct format_instance *fid __attribute((unused)),
|
||||||
struct logical_volume *lv)
|
struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
/******** FIXME Any LV size restriction?
|
/******** FIXME Any LV size restriction?
|
||||||
uint64_t max_size = UINT_MAX;
|
uint64_t max_size = UINT_MAX;
|
||||||
|
|
||||||
if (lv->size > max_size) {
|
if (lv->size > max_size) {
|
||||||
@ -581,7 +581,7 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
|
|||||||
if (!dev_write(mdac->area.dev,
|
if (!dev_write(mdac->area.dev,
|
||||||
mdac->area.start + MDA_HEADER_SIZE,
|
mdac->area.start + MDA_HEADER_SIZE,
|
||||||
(size_t) new_wrap,
|
(size_t) new_wrap,
|
||||||
fidtc->raw_metadata_buf +
|
fidtc->raw_metadata_buf +
|
||||||
mdac->rlocn.size - new_wrap))
|
mdac->rlocn.size - new_wrap))
|
||||||
goto_out;
|
goto_out;
|
||||||
}
|
}
|
||||||
@ -1092,7 +1092,7 @@ const char *vgname_from_mda(const struct format_type *fmt,
|
|||||||
|
|
||||||
log_debug("%s: Found metadata at %" PRIu64 " size %" PRIu64
|
log_debug("%s: Found metadata at %" PRIu64 " size %" PRIu64
|
||||||
" (in area at %" PRIu64 " size %" PRIu64
|
" (in area at %" PRIu64 " size %" PRIu64
|
||||||
") for %s (%s)",
|
") for %s (%s)",
|
||||||
dev_name(dev_area->dev), dev_area->start + rlocn->offset,
|
dev_name(dev_area->dev), dev_area->start + rlocn->offset,
|
||||||
rlocn->size, dev_area->start, dev_area->size, vgname, uuid);
|
rlocn->size, dev_area->start, dev_area->size, vgname, uuid);
|
||||||
|
|
||||||
@ -1330,7 +1330,7 @@ static int _text_pv_write(const struct format_type *fmt, struct physical_volume
|
|||||||
else
|
else
|
||||||
list_init(&info->das);
|
list_init(&info->das);
|
||||||
|
|
||||||
/* Set pe_start to first aligned sector after any metadata
|
/* Set pe_start to first aligned sector after any metadata
|
||||||
* areas that begin before pe_start */
|
* areas that begin before pe_start */
|
||||||
pv->pe_start = pe_align();
|
pv->pe_start = pe_align();
|
||||||
list_iterate_items(mda, &info->mdas) {
|
list_iterate_items(mda, &info->mdas) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -51,7 +51,7 @@ const char *text_vgname_import(const struct format_type *fmt,
|
|||||||
offset2, size2, checksum_fn, checksum)))
|
offset2, size2, checksum_fn, checksum)))
|
||||||
goto_out;
|
goto_out;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find a set of version functions that can read this file
|
* Find a set of version functions that can read this file
|
||||||
*/
|
*/
|
||||||
for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
|
for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
|
||||||
@ -104,7 +104,7 @@ struct volume_group *text_vg_import_fd(struct format_instance *fid,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find a set of version functions that can read this file
|
* Find a set of version functions that can read this file
|
||||||
*/
|
*/
|
||||||
for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
|
for (vsn = &_text_vsn_list[0]; *vsn; vsn++) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -225,24 +225,24 @@ static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
|
|||||||
pv->pe_alloc_count = 0;
|
pv->pe_alloc_count = 0;
|
||||||
pv->fmt = fid->fmt;
|
pv->fmt = fid->fmt;
|
||||||
|
|
||||||
/* Fix up pv size if missing or impossibly large */
|
/* Fix up pv size if missing or impossibly large */
|
||||||
if ((!pv->size || pv->size > (1ULL << 62)) && pv->dev) {
|
if ((!pv->size || pv->size > (1ULL << 62)) && pv->dev) {
|
||||||
if (!dev_get_size(pv->dev, &pv->size)) {
|
if (!dev_get_size(pv->dev, &pv->size)) {
|
||||||
log_error("%s: Couldn't get size.", pv_dev_name(pv));
|
log_error("%s: Couldn't get size.", pv_dev_name(pv));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
log_verbose("Fixing up missing size (%s) "
|
log_verbose("Fixing up missing size (%s) "
|
||||||
"for PV %s", display_size(fid->fmt->cmd, pv->size),
|
"for PV %s", display_size(fid->fmt->cmd, pv->size),
|
||||||
pv_dev_name(pv));
|
pv_dev_name(pv));
|
||||||
if (vg) {
|
if (vg) {
|
||||||
size = pv->pe_count * (uint64_t) vg->extent_size +
|
size = pv->pe_count * (uint64_t) vg->extent_size +
|
||||||
pv->pe_start;
|
pv->pe_start;
|
||||||
if (size > pv->size)
|
if (size > pv->size)
|
||||||
log_error("WARNING: Physical Volume %s is too "
|
log_error("WARNING: Physical Volume %s is too "
|
||||||
"large for underlying device",
|
"large for underlying device",
|
||||||
pv_dev_name(pv));
|
pv_dev_name(pv));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!alloc_pv_segment_whole_pv(mem, pv))
|
if (!alloc_pv_segment_whole_pv(mem, pv))
|
||||||
return_0;
|
return_0;
|
||||||
@ -834,7 +834,7 @@ static const char *_read_vgname(const struct format_type *fmt,
|
|||||||
old_suppress = log_suppress(2);
|
old_suppress = log_suppress(2);
|
||||||
*creation_host = dm_pool_strdup(mem,
|
*creation_host = dm_pool_strdup(mem,
|
||||||
find_config_str(cft->root,
|
find_config_str(cft->root,
|
||||||
"creation_host", ""));
|
"creation_host", ""));
|
||||||
log_suppress(old_suppress);
|
log_suppress(old_suppress);
|
||||||
|
|
||||||
/* skip any top-level values */
|
/* skip any top-level values */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -239,7 +239,7 @@ static int _text_read(struct labeller *l, struct device *dev, void *buf,
|
|||||||
|
|
||||||
list_iterate_items(mda, &info->mdas) {
|
list_iterate_items(mda, &info->mdas) {
|
||||||
mdac = (struct mda_context *) mda->metadata_locn;
|
mdac = (struct mda_context *) mda->metadata_locn;
|
||||||
if ((vgname = vgname_from_mda(info->fmt, &mdac->area,
|
if ((vgname = vgname_from_mda(info->fmt, &mdac->area,
|
||||||
&vgid, &vgstatus, &creation_host,
|
&vgid, &vgstatus, &creation_host,
|
||||||
&mdac->free_sectors)) &&
|
&mdac->free_sectors)) &&
|
||||||
!lvmcache_update_vgname_and_id(info, vgname,
|
!lvmcache_update_vgname_and_id(info, vgname,
|
||||||
|
@ -104,8 +104,8 @@ static int _send_request(char *inbuf, int inlen, char **retbuf)
|
|||||||
/* Send it to CLVMD */
|
/* Send it to CLVMD */
|
||||||
rewrite:
|
rewrite:
|
||||||
if ( (err = write(_clvmd_sock, inbuf, inlen)) != inlen) {
|
if ( (err = write(_clvmd_sock, inbuf, inlen)) != inlen) {
|
||||||
if (err == -1 && errno == EINTR)
|
if (err == -1 && errno == EINTR)
|
||||||
goto rewrite;
|
goto rewrite;
|
||||||
log_error("Error writing data to clvmd: %s", strerror(errno));
|
log_error("Error writing data to clvmd: %s", strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -113,8 +113,8 @@ static int _send_request(char *inbuf, int inlen, char **retbuf)
|
|||||||
/* Get the response */
|
/* Get the response */
|
||||||
reread:
|
reread:
|
||||||
if ((len = read(_clvmd_sock, outbuf, sizeof(struct clvm_header))) < 0) {
|
if ((len = read(_clvmd_sock, outbuf, sizeof(struct clvm_header))) < 0) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
goto reread;
|
goto reread;
|
||||||
log_error("Error reading data from clvmd: %s", strerror(errno));
|
log_error("Error reading data from clvmd: %s", strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -330,7 +330,7 @@ static int _lock_for_cluster(unsigned char cmd, uint32_t flags, const char *name
|
|||||||
* locks are cluster-wide.
|
* locks are cluster-wide.
|
||||||
* Also, if the lock is exclusive it makes no sense to try to
|
* Also, if the lock is exclusive it makes no sense to try to
|
||||||
* acquire it on all nodes, so just do that on the local node too.
|
* acquire it on all nodes, so just do that on the local node too.
|
||||||
* One exception, is that P_ locks /do/ get distributed across
|
* One exception, is that P_ locks /do/ get distributed across
|
||||||
* the cluster because they might have side-effects.
|
* the cluster because they might have side-effects.
|
||||||
*/
|
*/
|
||||||
if (strncmp(name, "P_", 2) &&
|
if (strncmp(name, "P_", 2) &&
|
||||||
@ -446,10 +446,10 @@ int lock_resource(struct cmd_context *cmd, const char *resource, uint32_t flags)
|
|||||||
|
|
||||||
log_very_verbose("Locking %s %s %s %s%s%s%s (0x%x)", lock_scope, lockname,
|
log_very_verbose("Locking %s %s %s %s%s%s%s (0x%x)", lock_scope, lockname,
|
||||||
lock_type,
|
lock_type,
|
||||||
flags & LCK_NONBLOCK ? "" : "B",
|
flags & LCK_NONBLOCK ? "" : "B",
|
||||||
flags & LCK_HOLD ? "H" : "",
|
flags & LCK_HOLD ? "H" : "",
|
||||||
flags & LCK_LOCAL ? "L" : "",
|
flags & LCK_LOCAL ? "L" : "",
|
||||||
flags & LCK_CLUSTER_VG ? "C" : "",
|
flags & LCK_CLUSTER_VG ? "C" : "",
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
/* Send a message to the cluster manager */
|
/* Send a message to the cluster manager */
|
||||||
@ -479,7 +479,7 @@ void reset_locking(void)
|
|||||||
|
|
||||||
_clvmd_sock = _open_local_sock();
|
_clvmd_sock = _open_local_sock();
|
||||||
if (_clvmd_sock == -1)
|
if (_clvmd_sock == -1)
|
||||||
stack;
|
stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CLUSTER_LOCKING_INTERNAL
|
#ifdef CLUSTER_LOCKING_INTERNAL
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -253,7 +253,7 @@ int init_locking(int type, struct cmd_context *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((type == 2 || type == 3) &&
|
if ((type == 2 || type == 3) &&
|
||||||
find_config_tree_int(cmd, "locking/fallback_to_local_locking",
|
find_config_tree_int(cmd, "locking/fallback_to_local_locking",
|
||||||
DEFAULT_FALLBACK_TO_LOCAL_LOCKING)) {
|
DEFAULT_FALLBACK_TO_LOCAL_LOCKING)) {
|
||||||
log_warn("WARNING: Falling back to local file-based locking.");
|
log_warn("WARNING: Falling back to local file-based locking.");
|
||||||
log_warn("Volume Groups with the clustered attribute will "
|
log_warn("Volume Groups with the clustered attribute will "
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1679,8 +1679,8 @@ static int _rename_cb(struct cmd_context *cmd, struct logical_volume *lv,
|
|||||||
*/
|
*/
|
||||||
static int _for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv,
|
static int _for_each_sub_lv(struct cmd_context *cmd, struct logical_volume *lv,
|
||||||
int (*func)(struct cmd_context *cmd,
|
int (*func)(struct cmd_context *cmd,
|
||||||
struct logical_volume *lv,
|
struct logical_volume *lv,
|
||||||
void *data),
|
void *data),
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct lv_segment *seg;
|
struct lv_segment *seg;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
/*
|
/*
|
||||||
* Attempt to merge two adjacent segments.
|
* Attempt to merge two adjacent segments.
|
||||||
* Currently only supports striped segments on AREA_PV.
|
* Currently only supports striped segments on AREA_PV.
|
||||||
* Returns success if successful, in which case 'first'
|
* Returns success if successful, in which case 'first'
|
||||||
* gets adjusted to contain both areas.
|
* gets adjusted to contain both areas.
|
||||||
*/
|
*/
|
||||||
static int _merge(struct lv_segment *first, struct lv_segment *second)
|
static int _merge(struct lv_segment *first, struct lv_segment *second)
|
||||||
@ -76,7 +76,7 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
|
|||||||
r = 0;
|
r = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
area_multiplier = segtype_is_striped(seg->segtype) ?
|
area_multiplier = segtype_is_striped(seg->segtype) ?
|
||||||
seg->area_count : 1;
|
seg->area_count : 1;
|
||||||
|
|
||||||
if (seg->area_len * area_multiplier != seg->len) {
|
if (seg->area_len * area_multiplier != seg->len) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -36,9 +36,9 @@
|
|||||||
#define pv_field(handle, field) \
|
#define pv_field(handle, field) \
|
||||||
(((const struct physical_volume *)(handle))->field)
|
(((const struct physical_volume *)(handle))->field)
|
||||||
|
|
||||||
static struct physical_volume *_pv_read(struct cmd_context *cmd,
|
static struct physical_volume *_pv_read(struct cmd_context *cmd,
|
||||||
const char *pv_name,
|
const char *pv_name,
|
||||||
struct list *mdas,
|
struct list *mdas,
|
||||||
uint64_t *label_sector,
|
uint64_t *label_sector,
|
||||||
int warnings);
|
int warnings);
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ static struct physical_volume *_pv_create(const struct format_type *fmt,
|
|||||||
int pvmetadatacopies,
|
int pvmetadatacopies,
|
||||||
uint64_t pvmetadatasize, struct list *mdas);
|
uint64_t pvmetadatasize, struct list *mdas);
|
||||||
|
|
||||||
static int _pv_write(struct cmd_context *cmd __attribute((unused)),
|
static int _pv_write(struct cmd_context *cmd __attribute((unused)),
|
||||||
struct physical_volume *pv,
|
struct physical_volume *pv,
|
||||||
struct list *mdas, int64_t label_sector);
|
struct list *mdas, int64_t label_sector);
|
||||||
|
|
||||||
@ -748,7 +748,7 @@ pv_t *pv_create(const struct format_type *fmt,
|
|||||||
int pvmetadatacopies,
|
int pvmetadatacopies,
|
||||||
uint64_t pvmetadatasize, struct list *mdas)
|
uint64_t pvmetadatasize, struct list *mdas)
|
||||||
{
|
{
|
||||||
return _pv_create(fmt, dev, id, size, pe_start,
|
return _pv_create(fmt, dev, id, size, pe_start,
|
||||||
existing_extent_count,
|
existing_extent_count,
|
||||||
existing_extent_size,
|
existing_extent_size,
|
||||||
pvmetadatacopies,
|
pvmetadatacopies,
|
||||||
@ -1392,7 +1392,7 @@ static int _update_pv_list(struct list *all_pvs, struct volume_group *vg)
|
|||||||
* inconsistent metadata on disk (i.e. the VG write lock is held).
|
* inconsistent metadata on disk (i.e. the VG write lock is held).
|
||||||
* This guarantees only consistent metadata is returned unless PARTIAL_VG.
|
* This guarantees only consistent metadata is returned unless PARTIAL_VG.
|
||||||
* If consistent is 0, caller must check whether consistent == 1 on return
|
* If consistent is 0, caller must check whether consistent == 1 on return
|
||||||
* and take appropriate action if it isn't (e.g. abort; get write lock
|
* and take appropriate action if it isn't (e.g. abort; get write lock
|
||||||
* and call vg_read again).
|
* and call vg_read again).
|
||||||
*
|
*
|
||||||
* If precommitted is set, use precommitted metadata if present.
|
* If precommitted is set, use precommitted metadata if present.
|
||||||
@ -1649,8 +1649,8 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vgname,
|
|||||||
return vg;
|
return vg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is only called by lv_from_lvid, which is only called from
|
/* This is only called by lv_from_lvid, which is only called from
|
||||||
* activate.c so we know the appropriate VG lock is already held and
|
* activate.c so we know the appropriate VG lock is already held and
|
||||||
* the vg_read is therefore safe.
|
* the vg_read is therefore safe.
|
||||||
*/
|
*/
|
||||||
static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
|
static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
|
||||||
@ -1688,7 +1688,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
|
|||||||
/* FIXME Disabled vgrenames while active for now because we aren't
|
/* FIXME Disabled vgrenames while active for now because we aren't
|
||||||
* allowed to do a full scan here any more. */
|
* allowed to do a full scan here any more. */
|
||||||
|
|
||||||
// The slow way - full scan required to cope with vgrename
|
// The slow way - full scan required to cope with vgrename
|
||||||
if (!(vgnames = get_vgs(cmd, 2))) {
|
if (!(vgnames = get_vgs(cmd, 2))) {
|
||||||
log_error("vg_read_by_vgid: get_vgs failed");
|
log_error("vg_read_by_vgid: get_vgs failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1697,7 +1697,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
|
|||||||
list_iterate_items(strl, vgnames) {
|
list_iterate_items(strl, vgnames) {
|
||||||
vgname = strl->str;
|
vgname = strl->str;
|
||||||
if (!vgname || is_orphan_vg(vgname))
|
if (!vgname || is_orphan_vg(vgname))
|
||||||
continue; // FIXME Unnecessary?
|
continue; // FIXME Unnecessary?
|
||||||
consistent = 0;
|
consistent = 0;
|
||||||
if ((vg = _vg_read(cmd, vgname, vgid, &consistent,
|
if ((vg = _vg_read(cmd, vgname, vgid, &consistent,
|
||||||
precommitted)) &&
|
precommitted)) &&
|
||||||
@ -1766,9 +1766,9 @@ struct physical_volume *pv_read(struct cmd_context *cmd, const char *pv_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME Use label functions instead of PV functions */
|
/* FIXME Use label functions instead of PV functions */
|
||||||
static struct physical_volume *_pv_read(struct cmd_context *cmd,
|
static struct physical_volume *_pv_read(struct cmd_context *cmd,
|
||||||
const char *pv_name,
|
const char *pv_name,
|
||||||
struct list *mdas,
|
struct list *mdas,
|
||||||
uint64_t *label_sector,
|
uint64_t *label_sector,
|
||||||
int warnings)
|
int warnings)
|
||||||
{
|
{
|
||||||
@ -1917,7 +1917,7 @@ int pv_write(struct cmd_context *cmd __attribute((unused)),
|
|||||||
return _pv_write(cmd, pv, mdas, label_sector);
|
return _pv_write(cmd, pv, mdas, label_sector);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _pv_write(struct cmd_context *cmd __attribute((unused)),
|
static int _pv_write(struct cmd_context *cmd __attribute((unused)),
|
||||||
struct physical_volume *pv,
|
struct physical_volume *pv,
|
||||||
struct list *mdas, int64_t label_sector)
|
struct list *mdas, int64_t label_sector)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -33,8 +33,8 @@
|
|||||||
#define MIRROR_DISK_VERSION 2
|
#define MIRROR_DISK_VERSION 2
|
||||||
|
|
||||||
/* These are the flags that represent the mirror failure restoration policies */
|
/* These are the flags that represent the mirror failure restoration policies */
|
||||||
#define MIRROR_REMOVE 0
|
#define MIRROR_REMOVE 0
|
||||||
#define MIRROR_ALLOCATE 1
|
#define MIRROR_ALLOCATE 1
|
||||||
#define MIRROR_ALLOCATE_ANYWHERE 2
|
#define MIRROR_ALLOCATE_ANYWHERE 2
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -146,7 +146,7 @@ struct pv_segment *assign_peg_to_lvseg(struct physical_volume *pv,
|
|||||||
if (!pv)
|
if (!pv)
|
||||||
return &null_pv_segment;
|
return &null_pv_segment;
|
||||||
|
|
||||||
if (!pv_split_segment(pv, pe) ||
|
if (!pv_split_segment(pv, pe) ||
|
||||||
!pv_split_segment(pv, pe + area_len))
|
!pv_split_segment(pv, pe + area_len))
|
||||||
return_NULL;
|
return_NULL;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ static int _create_single_area(struct dm_pool *mem, struct pv_map *pvm,
|
|||||||
static int _create_alloc_areas_for_pv(struct dm_pool *mem, struct pv_map *pvm,
|
static int _create_alloc_areas_for_pv(struct dm_pool *mem, struct pv_map *pvm,
|
||||||
uint32_t start, uint32_t count)
|
uint32_t start, uint32_t count)
|
||||||
{
|
{
|
||||||
struct pv_segment *peg;
|
struct pv_segment *peg;
|
||||||
uint32_t pe, end, area_len;
|
uint32_t pe, end, area_len;
|
||||||
|
|
||||||
/* Only select extents from start to end inclusive */
|
/* Only select extents from start to end inclusive */
|
||||||
@ -67,7 +67,7 @@ static int _create_alloc_areas_for_pv(struct dm_pool *mem, struct pv_map *pvm,
|
|||||||
pe = start;
|
pe = start;
|
||||||
|
|
||||||
/* Walk through complete ordered list of device segments */
|
/* Walk through complete ordered list of device segments */
|
||||||
list_iterate_items(peg, &pvm->pv->segments) {
|
list_iterate_items(peg, &pvm->pv->segments) {
|
||||||
/* pe holds the next extent we want to check */
|
/* pe holds the next extent we want to check */
|
||||||
|
|
||||||
/* Beyond the range we're interested in? */
|
/* Beyond the range we're interested in? */
|
||||||
@ -91,7 +91,7 @@ static int _create_alloc_areas_for_pv(struct dm_pool *mem, struct pv_map *pvm,
|
|||||||
|
|
||||||
next:
|
next:
|
||||||
pe = peg->pe + peg->len;
|
pe = peg->pe + peg->len;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -110,19 +110,19 @@ static int _mirrored_text_import(struct lv_segment *seg, const struct config_nod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cn = find_config_node(sn, "mirror_log"))) {
|
if ((cn = find_config_node(sn, "mirror_log"))) {
|
||||||
if (!cn->v || !cn->v->v.str) {
|
if (!cn->v || !cn->v->v.str) {
|
||||||
log_error("Mirror log type must be a string.");
|
log_error("Mirror log type must be a string.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
logname = cn->v->v.str;
|
logname = cn->v->v.str;
|
||||||
if (!(seg->log_lv = find_lv(seg->lv->vg, logname))) {
|
if (!(seg->log_lv = find_lv(seg->lv->vg, logname))) {
|
||||||
log_error("Unrecognised mirror log in segment %s.",
|
log_error("Unrecognised mirror log in segment %s.",
|
||||||
sn->key);
|
sn->key);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
seg->log_lv->status |= MIRROR_LOG;
|
seg->log_lv->status |= MIRROR_LOG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logname && !seg->region_size) {
|
if (logname && !seg->region_size) {
|
||||||
log_error("Missing region size for mirror log for segment "
|
log_error("Missing region size for mirror log for segment "
|
||||||
@ -232,7 +232,7 @@ static int _add_log(struct dev_manager *dm, struct lv_segment *seg,
|
|||||||
uint32_t log_flags = 0;
|
uint32_t log_flags = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use clustered mirror log for non-exclusive activation
|
* Use clustered mirror log for non-exclusive activation
|
||||||
* in clustered VG.
|
* in clustered VG.
|
||||||
*/
|
*/
|
||||||
if ((!(seg->lv->status & ACTIVATE_EXCL) &&
|
if ((!(seg->lv->status & ACTIVATE_EXCL) &&
|
||||||
@ -266,10 +266,10 @@ static int _add_log(struct dev_manager *dm, struct lv_segment *seg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int _mirrored_add_target_line(struct dev_manager *dm, struct dm_pool *mem,
|
static int _mirrored_add_target_line(struct dev_manager *dm, struct dm_pool *mem,
|
||||||
struct cmd_context *cmd, void **target_state,
|
struct cmd_context *cmd, void **target_state,
|
||||||
struct lv_segment *seg,
|
struct lv_segment *seg,
|
||||||
struct dm_tree_node *node, uint64_t len,
|
struct dm_tree_node *node, uint64_t len,
|
||||||
uint32_t *pvmove_mirror_count)
|
uint32_t *pvmove_mirror_count)
|
||||||
{
|
{
|
||||||
struct mirror_state *mirr_state;
|
struct mirror_state *mirr_state;
|
||||||
uint32_t area_count = seg->area_count;
|
uint32_t area_count = seg->area_count;
|
||||||
@ -349,7 +349,7 @@ static int _mirrored_target_present(const struct lv_segment *seg __attribute((un
|
|||||||
static int _mirrored_present = 0;
|
static int _mirrored_present = 0;
|
||||||
uint32_t maj, min, patchlevel;
|
uint32_t maj, min, patchlevel;
|
||||||
unsigned maj2, min2, patchlevel2;
|
unsigned maj2, min2, patchlevel2;
|
||||||
char vsn[80];
|
char vsn[80];
|
||||||
|
|
||||||
if (!_mirrored_checked) {
|
if (!_mirrored_checked) {
|
||||||
_mirrored_present = target_present("mirror", 1);
|
_mirrored_present = target_present("mirror", 1);
|
||||||
@ -361,8 +361,8 @@ static int _mirrored_target_present(const struct lv_segment *seg __attribute((un
|
|||||||
/* FIXME Move this into libdevmapper */
|
/* FIXME Move this into libdevmapper */
|
||||||
|
|
||||||
if (target_version("mirror", &maj, &min, &patchlevel) &&
|
if (target_version("mirror", &maj, &min, &patchlevel) &&
|
||||||
maj == 1 &&
|
maj == 1 &&
|
||||||
((min >= 1 && min <= 11) ||
|
((min >= 1 && min <= 11) ||
|
||||||
(min == 0 && driver_version(vsn, sizeof(vsn)) &&
|
(min == 0 && driver_version(vsn, sizeof(vsn)) &&
|
||||||
sscanf(vsn, "%u.%u.%u", &maj2, &min2, &patchlevel2) == 3 &&
|
sscanf(vsn, "%u.%u.%u", &maj2, &min2, &patchlevel2) == 3 &&
|
||||||
maj2 == 4 && min2 == 5 && patchlevel2 == 0))) /* RHEL4U3 */
|
maj2 == 4 && min2 == 5 && patchlevel2 == 0))) /* RHEL4U3 */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -151,8 +151,8 @@ void memlock_init(struct cmd_context *cmd)
|
|||||||
"activation/reserved_memory",
|
"activation/reserved_memory",
|
||||||
DEFAULT_RESERVED_MEMORY) * 1024;
|
DEFAULT_RESERVED_MEMORY) * 1024;
|
||||||
_default_priority = find_config_tree_int(cmd,
|
_default_priority = find_config_tree_int(cmd,
|
||||||
"activation/process_priority",
|
"activation/process_priority",
|
||||||
DEFAULT_PROCESS_PRIORITY);
|
DEFAULT_PROCESS_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,7 +115,7 @@ static int _format_pvsegs(struct dm_pool *mem, struct dm_report_field *field,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dm_snprintf(extent_str, sizeof(extent_str),
|
if (dm_snprintf(extent_str, sizeof(extent_str),
|
||||||
"%s%" PRIu32 "%s",
|
"%s%" PRIu32 "%s",
|
||||||
range_format ? ":" : "(", extent,
|
range_format ? ":" : "(", extent,
|
||||||
range_format ? "-" : ")") < 0) {
|
range_format ? "-" : ")") < 0) {
|
||||||
log_error("Extent number dm_snprintf failed");
|
log_error("Extent number dm_snprintf failed");
|
||||||
@ -128,7 +128,7 @@ static int _format_pvsegs(struct dm_pool *mem, struct dm_report_field *field,
|
|||||||
|
|
||||||
if (range_format) {
|
if (range_format) {
|
||||||
if (dm_snprintf(extent_str, sizeof(extent_str),
|
if (dm_snprintf(extent_str, sizeof(extent_str),
|
||||||
"%" PRIu32, extent + seg->area_len - 1) < 0) {
|
"%" PRIu32, extent + seg->area_len - 1) < 0) {
|
||||||
log_error("Extent number dm_snprintf failed");
|
log_error("Extent number dm_snprintf failed");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -830,7 +830,7 @@ static int _pvmdas_disp(struct dm_report *rh, struct dm_pool *mem,
|
|||||||
struct dm_report_field *field,
|
struct dm_report_field *field,
|
||||||
const void *data, void *private)
|
const void *data, void *private)
|
||||||
{
|
{
|
||||||
struct lvmcache_info *info;
|
struct lvmcache_info *info;
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
const char *pvid = (const char *)(&((struct id *) data)->uuid);
|
const char *pvid = (const char *)(&((struct id *) data)->uuid);
|
||||||
|
|
||||||
@ -856,7 +856,7 @@ static int _pvmdafree_disp(struct dm_report *rh, struct dm_pool *mem,
|
|||||||
struct dm_report_field *field,
|
struct dm_report_field *field,
|
||||||
const void *data, void *private)
|
const void *data, void *private)
|
||||||
{
|
{
|
||||||
struct lvmcache_info *info;
|
struct lvmcache_info *info;
|
||||||
uint64_t freespace = UINT64_MAX, mda_free;
|
uint64_t freespace = UINT64_MAX, mda_free;
|
||||||
const char *pvid = (const char *)(&((struct id *) data)->uuid);
|
const char *pvid = (const char *)(&((struct id *) data)->uuid);
|
||||||
struct metadata_area *mda;
|
struct metadata_area *mda;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -154,11 +154,11 @@ static int _striped_merge_segments(struct lv_segment *seg1, struct lv_segment *s
|
|||||||
#ifdef DEVMAPPER_SUPPORT
|
#ifdef DEVMAPPER_SUPPORT
|
||||||
static int _striped_add_target_line(struct dev_manager *dm,
|
static int _striped_add_target_line(struct dev_manager *dm,
|
||||||
struct dm_pool *mem __attribute((unused)),
|
struct dm_pool *mem __attribute((unused)),
|
||||||
struct cmd_context *cmd __attribute((unused)),
|
struct cmd_context *cmd __attribute((unused)),
|
||||||
void **target_state __attribute((unused)),
|
void **target_state __attribute((unused)),
|
||||||
struct lv_segment *seg,
|
struct lv_segment *seg,
|
||||||
struct dm_tree_node *node, uint64_t len,
|
struct dm_tree_node *node, uint64_t len,
|
||||||
uint32_t *pvmove_mirror_count __attribute((unused)))
|
uint32_t *pvmove_mirror_count __attribute((unused)))
|
||||||
{
|
{
|
||||||
if (!seg->area_count) {
|
if (!seg->area_count) {
|
||||||
log_error("Internal error: striped add_target_line called "
|
log_error("Internal error: striped add_target_line called "
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -93,10 +93,10 @@ int id_create(struct id *id)
|
|||||||
if (close(randomfile))
|
if (close(randomfile))
|
||||||
stack;
|
stack;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip out the last 2 chars in randomized creation for LVM1
|
* Skip out the last 2 chars in randomized creation for LVM1
|
||||||
* backwards compatibility.
|
* backwards compatibility.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
id->uuid[i] = _c[id->uuid[i] % (sizeof(_c) - 3)];
|
id->uuid[i] = _c[id->uuid[i] % (sizeof(_c) - 3)];
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ static int _zero_merge_segments(struct lv_segment *seg1, struct lv_segment *seg2
|
|||||||
|
|
||||||
#ifdef DEVMAPPER_SUPPORT
|
#ifdef DEVMAPPER_SUPPORT
|
||||||
static int _zero_add_target_line(struct dev_manager *dm __attribute((unused)),
|
static int _zero_add_target_line(struct dev_manager *dm __attribute((unused)),
|
||||||
struct dm_pool *mem __attribute((unused)),
|
struct dm_pool *mem __attribute((unused)),
|
||||||
struct cmd_context *cmd __attribute((unused)),
|
struct cmd_context *cmd __attribute((unused)),
|
||||||
void **target_state __attribute((unused)),
|
void **target_state __attribute((unused)),
|
||||||
struct lv_segment *seg __attribute((unused)),
|
struct lv_segment *seg __attribute((unused)),
|
||||||
struct dm_tree_node *node,uint64_t len,
|
struct dm_tree_node *node,uint64_t len,
|
||||||
uint32_t *pvmove_mirror_count __attribute((unused)))
|
uint32_t *pvmove_mirror_count __attribute((unused)))
|
||||||
{
|
{
|
||||||
return dm_tree_node_add_zero_target(node, len);
|
return dm_tree_node_add_zero_target(node, len);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -238,7 +238,7 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
|
|||||||
static struct volume_group *_get_lvconvert_vg(struct cmd_context *cmd,
|
static struct volume_group *_get_lvconvert_vg(struct cmd_context *cmd,
|
||||||
const char *lv_name)
|
const char *lv_name)
|
||||||
{
|
{
|
||||||
dev_close_all();
|
dev_close_all();
|
||||||
|
|
||||||
return vg_lock_and_read(cmd, extract_vgname(cmd, lv_name),
|
return vg_lock_and_read(cmd, extract_vgname(cmd, lv_name),
|
||||||
NULL, LCK_VG_WRITE,
|
NULL, LCK_VG_WRITE,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -435,7 +435,7 @@ static int _lvcreate_params(struct lvcreate_params *lp, struct cmd_context *cmd,
|
|||||||
/*
|
/*
|
||||||
* Should we zero the lv.
|
* Should we zero the lv.
|
||||||
*/
|
*/
|
||||||
lp->zero = strcmp(arg_str_value(cmd, zero_ARG,
|
lp->zero = strcmp(arg_str_value(cmd, zero_ARG,
|
||||||
(lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
|
(lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -663,7 +663,7 @@ static int _lvcreate(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
log_error("Snapshots and mirrors may not yet be mixed.");
|
log_error("Snapshots and mirrors may not yet be mixed.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must zero cow */
|
/* Must zero cow */
|
||||||
status |= LVM_WRITE;
|
status |= LVM_WRITE;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -945,7 +945,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
if (!refresh_toolcontext(cmd))
|
if (!refresh_toolcontext(cmd))
|
||||||
stack;
|
stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME Move this? */
|
/* FIXME Move this? */
|
||||||
cmd->current_settings = cmd->default_settings;
|
cmd->current_settings = cmd->default_settings;
|
||||||
_apply_settings(cmd);
|
_apply_settings(cmd);
|
||||||
@ -1159,7 +1159,7 @@ int lvm2_main(int argc, char **argv, unsigned is_static)
|
|||||||
strcmp(base, "initrd-lvm"))
|
strcmp(base, "initrd-lvm"))
|
||||||
alias = 1;
|
alias = 1;
|
||||||
|
|
||||||
if (is_static && strcmp(base, "lvm.static") &&
|
if (is_static && strcmp(base, "lvm.static") &&
|
||||||
path_exists(LVM_SHARED_PATH) &&
|
path_exists(LVM_SHARED_PATH) &&
|
||||||
!getenv("LVM_DID_EXEC")) {
|
!getenv("LVM_DID_EXEC")) {
|
||||||
setenv("LVM_DID_EXEC", base, 1);
|
setenv("LVM_DID_EXEC", base, 1);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -130,7 +130,7 @@ static int confirm_resizefs_reduce(struct cmd_context *cmd,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_resizefs_reduce(const struct cmd_context *cmd,
|
static int do_resizefs_reduce(const struct cmd_context *cmd,
|
||||||
const struct volume_group *vg,
|
const struct volume_group *vg,
|
||||||
const struct lvresize_params *lp)
|
const struct lvresize_params *lp)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -202,7 +202,7 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
|
|||||||
continue;
|
continue;
|
||||||
if (!(name = parms->poll_fns->get_copy_name_from_lv(lv_mirr)))
|
if (!(name = parms->poll_fns->get_copy_name_from_lv(lv_mirr)))
|
||||||
continue;
|
continue;
|
||||||
/* FIXME Need to do the activation from _set_up_pvmove here
|
/* FIXME Need to do the activation from _set_up_pvmove here
|
||||||
* if it's not running and we're not aborting */
|
* if it's not running and we're not aborting */
|
||||||
if (_check_mirror_status(cmd, vg, lv_mirr, name,
|
if (_check_mirror_status(cmd, vg, lv_mirr, name,
|
||||||
parms, &finished) && !finished)
|
parms, &finished) && !finished)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -45,10 +45,10 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name)
|
|||||||
pv = pv_read(cmd, name, NULL, NULL, 0);
|
pv = pv_read(cmd, name, NULL, NULL, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If a PV has no MDAs it may appear to be an orphan until the
|
* If a PV has no MDAs it may appear to be an orphan until the
|
||||||
* metadata is read off another PV in the same VG. Detecting
|
* metadata is read off another PV in the same VG. Detecting
|
||||||
* this means checking every VG by scanning every PV on the
|
* this means checking every VG by scanning every PV on the
|
||||||
* system.
|
* system.
|
||||||
*/
|
*/
|
||||||
if (pv && is_orphan(pv)) {
|
if (pv && is_orphan(pv)) {
|
||||||
if (!scan_vgs_for_pvs(cmd))
|
if (!scan_vgs_for_pvs(cmd))
|
||||||
@ -109,7 +109,7 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name)
|
|||||||
if (dev_is_md(dev, &md_superblock) &&
|
if (dev_is_md(dev, &md_superblock) &&
|
||||||
((!arg_count(cmd, uuidstr_ARG) &&
|
((!arg_count(cmd, uuidstr_ARG) &&
|
||||||
!arg_count(cmd, restorefile_ARG)) ||
|
!arg_count(cmd, restorefile_ARG)) ||
|
||||||
arg_count(cmd, yes_ARG) ||
|
arg_count(cmd, yes_ARG) ||
|
||||||
(yes_no_prompt("Software RAID md superblock "
|
(yes_no_prompt("Software RAID md superblock "
|
||||||
"detected on %s. Wipe it? [y/n] ", name) == 'y'))) {
|
"detected on %s. Wipe it? [y/n] ", name) == 'y'))) {
|
||||||
log_print("Wiping software RAID md superblock on %s", name);
|
log_print("Wiping software RAID md superblock on %s", name);
|
||||||
|
@ -30,10 +30,10 @@ static int _pvdisplay_single(struct cmd_context *cmd,
|
|||||||
vg_name = pv_vg_name(pv);
|
vg_name = pv_vg_name(pv);
|
||||||
if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,
|
if (!(vg = vg_lock_and_read(cmd, vg_name, (char *)&pv->vgid,
|
||||||
LCK_VG_READ, CLUSTERED, 0))) {
|
LCK_VG_READ, CLUSTERED, 0))) {
|
||||||
log_error("Skipping volume group %s", vg_name);
|
log_error("Skipping volume group %s", vg_name);
|
||||||
/* FIXME If CLUSTERED should return ECMD_PROCESSED here */
|
/* FIXME If CLUSTERED should return ECMD_PROCESSED here */
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace possibly incomplete PV structure with new one
|
* Replace possibly incomplete PV structure with new one
|
||||||
@ -42,8 +42,8 @@ static int _pvdisplay_single(struct cmd_context *cmd,
|
|||||||
if (!(pvl = find_pv_in_vg(vg, pv_name))) {
|
if (!(pvl = find_pv_in_vg(vg, pv_name))) {
|
||||||
log_error("Unable to find \"%s\" in volume group \"%s\"",
|
log_error("Unable to find \"%s\" in volume group \"%s\"",
|
||||||
pv_name, vg->name);
|
pv_name, vg->name);
|
||||||
ret = ECMD_FAILED;
|
ret = ECMD_FAILED;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
pv = pvl->pv;
|
pv = pvl->pv;
|
||||||
@ -52,7 +52,7 @@ static int _pvdisplay_single(struct cmd_context *cmd,
|
|||||||
if (is_orphan(pv))
|
if (is_orphan(pv))
|
||||||
size = pv_size(pv);
|
size = pv_size(pv);
|
||||||
else
|
else
|
||||||
size = (pv_pe_count(pv) - pv_pe_alloc_count(pv)) *
|
size = (pv_pe_count(pv) - pv_pe_alloc_count(pv)) *
|
||||||
pv_pe_size(pv);
|
pv_pe_size(pv);
|
||||||
|
|
||||||
if (arg_count(cmd, short_ARG)) {
|
if (arg_count(cmd, short_ARG)) {
|
||||||
@ -80,8 +80,8 @@ static int _pvdisplay_single(struct cmd_context *cmd,
|
|||||||
pvdisplay_segments(pv);
|
pvdisplay_segments(pv);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (vg_name)
|
if (vg_name)
|
||||||
unlock_vg(cmd, vg_name);
|
unlock_vg(cmd, vg_name);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -530,12 +530,12 @@ int pvmove(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
if (!(segtype = get_segtype_from_string(cmd, "mirror")))
|
if (!(segtype = get_segtype_from_string(cmd, "mirror")))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
if (activation() && segtype->ops->target_present &&
|
if (activation() && segtype->ops->target_present &&
|
||||||
!segtype->ops->target_present(NULL)) {
|
!segtype->ops->target_present(NULL)) {
|
||||||
log_error("%s: Required device-mapper target(s) not "
|
log_error("%s: Required device-mapper target(s) not "
|
||||||
"detected in your kernel", segtype->name);
|
"detected in your kernel", segtype->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc) {
|
if (argc) {
|
||||||
pv_name = argv[0];
|
pv_name = argv[0];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
|
||||||
* Copyright (C) 2005 Zak Kipling. All rights reserved.
|
* Copyright (C) 2005 Zak Kipling. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -89,9 +89,9 @@ static void _pvscan_display_single(struct cmd_context *cmd,
|
|||||||
log_print("PV %-*s VG %-*s %s [%s / %s free]", pv_max_name_len,
|
log_print("PV %-*s VG %-*s %s [%s / %s free]", pv_max_name_len,
|
||||||
pv_tmp_name, vg_max_name_len, vg_tmp_name,
|
pv_tmp_name, vg_max_name_len, vg_tmp_name,
|
||||||
pv->fmt ? pv->fmt->name : " ",
|
pv->fmt ? pv->fmt->name : " ",
|
||||||
display_size(cmd, (uint64_t) pv_pe_count(pv) *
|
display_size(cmd, (uint64_t) pv_pe_count(pv) *
|
||||||
pv_pe_size(pv)),
|
pv_pe_size(pv)),
|
||||||
display_size(cmd, (uint64_t) (pv_pe_count(pv) -
|
display_size(cmd, (uint64_t) (pv_pe_count(pv) -
|
||||||
pv_pe_alloc_count(pv)) *
|
pv_pe_alloc_count(pv)) *
|
||||||
pv_pe_size(pv)));
|
pv_pe_size(pv)));
|
||||||
return;
|
return;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -111,7 +111,7 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
pv = pvl->pv;
|
pv = pvl->pv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!report_object(handle, vg, NULL, pv, NULL, NULL))
|
if (!report_object(handle, vg, NULL, pv, NULL, NULL))
|
||||||
@ -132,7 +132,7 @@ static int _pvs_in_vg(struct cmd_context *cmd, const char *vg_name,
|
|||||||
if (!vg) {
|
if (!vg) {
|
||||||
log_error("Volume group %s not found", vg_name);
|
log_error("Volume group %s not found", vg_name);
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
|
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ static int _pvsegs_in_vg(struct cmd_context *cmd, const char *vg_name,
|
|||||||
if (!vg) {
|
if (!vg) {
|
||||||
log_error("Volume group %s not found", vg_name);
|
log_error("Volume group %s not found", vg_name);
|
||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvsegs_single);
|
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvsegs_single);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -736,13 +736,13 @@ int process_each_pv(struct cmd_context *cmd, int argc, char **argv,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If a PV has no MDAs it may appear to be an
|
* If a PV has no MDAs it may appear to be an
|
||||||
* orphan until the metadata is read off
|
* orphan until the metadata is read off
|
||||||
* another PV in the same VG. Detecting this
|
* another PV in the same VG. Detecting this
|
||||||
* means checking every VG by scanning every
|
* means checking every VG by scanning every
|
||||||
* PV on the system.
|
* PV on the system.
|
||||||
*/
|
*/
|
||||||
if (!scanned && is_orphan(pv)) {
|
if (!scanned && is_orphan(pv)) {
|
||||||
if (!scan_vgs_for_pvs(cmd)) {
|
if (!scan_vgs_for_pvs(cmd)) {
|
||||||
stack;
|
stack;
|
||||||
@ -1251,7 +1251,7 @@ int fill_vg_create_params(struct cmd_context *cmd,
|
|||||||
arg_uint_value(cmd, physicalextentsize_ARG, vp_def->extent_size);
|
arg_uint_value(cmd, physicalextentsize_ARG, vp_def->extent_size);
|
||||||
|
|
||||||
if (arg_count(cmd, clustered_ARG))
|
if (arg_count(cmd, clustered_ARG))
|
||||||
vp_new->clustered =
|
vp_new->clustered =
|
||||||
!strcmp(arg_str_value(cmd, clustered_ARG,
|
!strcmp(arg_str_value(cmd, clustered_ARG,
|
||||||
vp_def->clustered ? "y":"n"), "y");
|
vp_def->clustered ? "y":"n"), "y");
|
||||||
else
|
else
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -256,8 +256,8 @@ static int _vgchange_clustered(struct cmd_context *cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (clustered) {
|
if (clustered) {
|
||||||
list_iterate_items(lvl, &vg->lvs) {
|
list_iterate_items(lvl, &vg->lvs) {
|
||||||
if (lv_is_origin(lvl->lv) || lv_is_cow(lvl->lv)) {
|
if (lv_is_origin(lvl->lv) || lv_is_cow(lvl->lv)) {
|
||||||
log_error("Volume group %s contains snapshots "
|
log_error("Volume group %s contains snapshots "
|
||||||
"that are not yet supported.",
|
"that are not yet supported.",
|
||||||
vg->name);
|
vg->name);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -89,8 +89,8 @@ int vgdisplay(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
|
|
||||||
/* FIXME -D disk_ARG is now redundant */
|
/* FIXME -D disk_ARG is now redundant */
|
||||||
|
|
||||||
/********* FIXME: Do without this - or else 2(+) passes!
|
/********* FIXME: Do without this - or else 2(+) passes!
|
||||||
Figure out longest volume group name
|
Figure out longest volume group name
|
||||||
for (c = opt; opt < argc; opt++) {
|
for (c = opt; opt < argc; opt++) {
|
||||||
len = strlen(argv[opt]);
|
len = strlen(argv[opt]);
|
||||||
if (len > max_len)
|
if (len > max_len)
|
||||||
@ -101,8 +101,8 @@ int vgdisplay(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
process_each_vg(cmd, argc, argv, LCK_VG_READ, 0, NULL,
|
process_each_vg(cmd, argc, argv, LCK_VG_READ, 0, NULL,
|
||||||
vgdisplay_single);
|
vgdisplay_single);
|
||||||
|
|
||||||
/******** FIXME Need to count number processed
|
/******** FIXME Need to count number processed
|
||||||
Add this to process_each_vg if arg_count(cmd,activevolumegroups_ARG) ?
|
Add this to process_each_vg if arg_count(cmd,activevolumegroups_ARG) ?
|
||||||
|
|
||||||
if (opt == argc) {
|
if (opt == argc) {
|
||||||
log_print("no ");
|
log_print("no ");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -42,7 +42,7 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
|
|||||||
|
|
||||||
log_verbose("Checking for volume group \"%s\"", vg_name);
|
log_verbose("Checking for volume group \"%s\"", vg_name);
|
||||||
if (!(vg = vg_lock_and_read(cmd, vg_name, NULL, LCK_VG_WRITE | LCK_NONBLOCK,
|
if (!(vg = vg_lock_and_read(cmd, vg_name, NULL, LCK_VG_WRITE | LCK_NONBLOCK,
|
||||||
CLUSTERED | EXPORTED_VG |
|
CLUSTERED | EXPORTED_VG |
|
||||||
LVM_WRITE | RESIZEABLE_VG,
|
LVM_WRITE | RESIZEABLE_VG,
|
||||||
CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) {
|
CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) {
|
||||||
unlock_vg(cmd, VG_ORPHANS);
|
unlock_vg(cmd, VG_ORPHANS);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -70,23 +70,23 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
|
|||||||
list_iterate_items(lvl2, &vg_from->lvs) {
|
list_iterate_items(lvl2, &vg_from->lvs) {
|
||||||
union lvid *lvid2 = &lvl2->lv->lvid;
|
union lvid *lvid2 = &lvl2->lv->lvid;
|
||||||
|
|
||||||
if (id_equal(&lvid1->id[1], &lvid2->id[1])) {
|
if (id_equal(&lvid1->id[1], &lvid2->id[1])) {
|
||||||
if (!id_create(&lvid2->id[1])) {
|
if (!id_create(&lvid2->id[1])) {
|
||||||
log_error("Failed to generate new "
|
log_error("Failed to generate new "
|
||||||
"random LVID for %s",
|
"random LVID for %s",
|
||||||
lvl2->lv->name);
|
lvl2->lv->name);
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
if (!id_write_format(&lvid2->id[1], uuid,
|
if (!id_write_format(&lvid2->id[1], uuid,
|
||||||
sizeof(uuid)))
|
sizeof(uuid)))
|
||||||
goto_bad;
|
goto_bad;
|
||||||
|
|
||||||
log_verbose("Changed LVID for %s to %s",
|
log_verbose("Changed LVID for %s to %s",
|
||||||
lvl2->lv->name, uuid);
|
lvl2->lv->name, uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!list_empty(&vg_from->lvs)) {
|
while (!list_empty(&vg_from->lvs)) {
|
||||||
struct list *lvh = vg_from->lvs.n;
|
struct list *lvh = vg_from->lvs.n;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
|
||||||
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of LVM2.
|
* This file is part of LVM2.
|
||||||
@ -100,7 +100,7 @@ static int _remove_lv(struct cmd_context *cmd, struct logical_volume *lv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If LV is active, replace it with error segment
|
* If LV is active, replace it with error segment
|
||||||
* and add to list of LVs to be removed later.
|
* and add to list of LVs to be removed later.
|
||||||
* Doesn't apply to snapshots/origins yet - they're already deactivated.
|
* Doesn't apply to snapshots/origins yet - they're already deactivated.
|
||||||
*/
|
*/
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user