static DM_LIST_INIT(_found_duplicate_devs);
static DM_LIST_INIT(_unused_duplicate_devs);
static int _scanning_in_progress = 0;
-static int _has_scanned = 0;
static int _vgs_locked = 0;
static int _found_duplicate_pvs = 0; /* If we never see a duplicate PV we can skip checking for them later. */
{
log_debug_cache("Dropping VG info");
- _has_scanned = 0;
-
if (_vgid_hash) {
dm_hash_destroy(_vgid_hash);
_vgid_hash = NULL;
void dev_cache_failed_path(struct device *dev, const char *path)
{
- struct device *dev_by_path;
struct dm_str_list *strl;
- if ((dev_by_path = (struct device *) dm_hash_lookup(_cache.names, path)))
+ if (dm_hash_lookup(_cache.names, path))
dm_hash_remove(_cache.names, path);
dm_list_iterate_items(strl, &dev->aliases) {
int lv_name_is_used_in_vg(const struct volume_group *vg, const char *name, int *historical)
{
- struct generic_logical_volume *historical_lv;
- struct logical_volume *lv;
int found = 0;
- if ((lv = find_lv(vg, name))) {
+ if (find_lv(vg, name)) {
found = 1;
if (historical)
*historical = 0;
- } else if ((historical_lv = find_historical_glv(vg, name, 0, NULL))) {
+ } else if (find_historical_glv(vg, name, 0, NULL)) {
found = 1;
if (historical)
*historical = 1;
static int _daemonise(struct filemap_monitor *fm)
{
- pid_t pid = 0, sid;
+ pid_t pid = 0;
int fd;
- if (!(sid = setsid())) {
+ if (!setsid()) {
_early_log("setsid failed.");
return 0;
}
int disable_remove,
const char **pvid_without_metadata)
{
- struct label *label;
struct lvmcache_info *info;
struct _pvscan_baton baton;
const struct format_type *fmt;
return 1;
}
- if (!(label = lvmcache_get_label(info))) {
+ if (!lvmcache_get_label(info)) {
log_debug("No PV label found for %s.", dev_name(dev));
if (!disable_remove)
_online_pvid_file_remove_devno((int)MAJOR(dev->dev), (int)MINOR(dev->dev));
{
int ret = ECMD_PROCESSED;
unsigned i;
- activation_change_t activate = CHANGE_AN;
+ activation_change_t activate;
static const struct {
int arg;