~ubuntu-branches/debian/sid/lvm2/sid

« back to all changes in this revision

Viewing changes to tools/pvscan.c

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2014-08-19 15:37:06 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20140819153706-i1gaio8lg534dara
Tags: 2.02.109-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
static int _clear_dev_from_lvmetad_cache(dev_t devno, int32_t major, int32_t minor,
165
165
                                         activation_handler handler)
166
166
{
167
 
        char *buf;
168
 
 
169
 
        if (!dm_asprintf(&buf, "%" PRIi32 ":%" PRIi32, major, minor))
170
 
                stack;
171
 
        if (!lvmetad_pv_gone(devno, buf ? : "", handler)) {
172
 
                dm_free(buf);
173
 
                return 0;
174
 
        }
 
167
        char buf[24];
 
168
 
 
169
        (void) dm_snprintf(buf, sizeof(buf), "%" PRIi32 ":%" PRIi32, major, minor);
 
170
 
 
171
        if (!lvmetad_pv_gone(devno, buf, handler))
 
172
                return_0;
175
173
 
176
174
        log_print_unless_silent("Device %s not found. "
177
 
                                "Cleared from lvmetad cache.", buf ? : "");
178
 
        dm_free(buf);
 
175
                                "Cleared from lvmetad cache.", buf);
179
176
 
180
177
        return 1;
181
178
}
201
198
         * and to prevent hangs in clustered environment.
202
199
         */
203
200
        /* TODO: Remove this once lvmetad + cluster supported! */
204
 
        if (find_config_tree_int(cmd, global_locking_type_CFG, NULL) == 3 ||
205
 
            !find_config_tree_bool(cmd, global_use_lvmetad_CFG, NULL)) {
206
 
                log_debug_lvmetad("_pvscan_lvmetad: immediate return");
 
201
        if (!lvmetad_used()) {
 
202
                log_verbose("Ignoring pvscan --cache command because lvmetad is not in use.");
207
203
                return ret;
208
204
        }
209
205