log_error("Failed to allocate memory for cache_pool segtype");
return 0;
}
- segtype->cmd = cmd;
segtype->name = "cache-pool";
segtype->flags = SEG_CACHE_POOL | SEG_CANNOT_BE_ZEROED;
segtype->ops = &_cache_pool_ops;
- segtype->private = NULL;
if (!lvm_register_segtype(seglib, segtype))
return_0;
log_error("Failed to allocate memory for cache segtype");
return 0;
}
- segtype->cmd = cmd;
segtype->name = "cache";
segtype->flags = SEG_CACHE;
segtype->ops = &_cache_ops;
- segtype->private = NULL;
if (!lvm_register_segtype(seglib, segtype))
return_0;
struct segment_type *segtype2;
segtype->library = seglib->lib;
- segtype->cmd = seglib->cmd;
dm_list_iterate_items(segtype2, &seglib->cmd->segtypes) {
if (strcmp(segtype2->name, segtype->name))
if (!segtype)
return_NULL;
- segtype->cmd = cmd;
segtype->ops = &_error_ops;
segtype->name = "error";
- segtype->private = NULL;
segtype->flags = SEG_CAN_SPLIT | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
log_very_verbose("Initialised segtype: %s", segtype->name);
if (!segtype)
return_NULL;
- segtype->cmd = cmd;
segtype->ops = &_freeseg_ops;
segtype->name = "free";
- segtype->private = NULL;
segtype->flags = SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
log_very_verbose("Initialised segtype: %s", segtype->name);
struct segment_type {
struct dm_list list; /* Internal */
- struct cmd_context *cmd; /* lvm_register_segtype() sets this. */
uint32_t flags;
uint32_t parity_devs; /* Parity drives required by segtype */
if (!segtype)
return_NULL;
- segtype->cmd = cmd;
segtype->ops = &_mirrored_ops;
segtype->name = "mirror";
- segtype->private = NULL;
segtype->flags = SEG_MIRROR | SEG_AREAS_MIRRORED;
#ifdef DEVMAPPER_SUPPORT
rt->name);
return NULL;
}
- segtype->cmd = cmd;
+
segtype->ops = &_raid_ops;
segtype->name = rt->name;
segtype->flags = SEG_RAID | rt->extra_flags | monitored;
if (!segtype)
return_NULL;
- segtype->cmd = cmd;
segtype->ops = &_snapshot_ops;
segtype->name = "snapshot";
- segtype->private = NULL;
segtype->flags = SEG_SNAPSHOT | SEG_CANNOT_BE_ZEROED;
#ifdef DEVMAPPER_SUPPORT
if (!segtype)
return_NULL;
- segtype->cmd = cmd;
segtype->ops = &_striped_ops;
segtype->name = "striped";
- segtype->private = NULL;
segtype->flags =
SEG_CAN_SPLIT | SEG_AREAS_STRIPED | SEG_FORMAT1_SUPPORT;
return NULL;
}
- segtype->cmd = cmd;
segtype->ops = &_unknown_ops;
segtype->name = dm_pool_strdup(cmd->libmem, name);
- segtype->private = NULL;
segtype->flags = SEG_UNKNOWN | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
log_very_verbose("Initialised segtype: %s", segtype->name);
if (!segtype)
return_NULL;
- segtype->cmd = cmd;
segtype->ops = &_zero_ops;
segtype->name = "zero";
- segtype->private = NULL;
segtype->flags = SEG_CAN_SPLIT | SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED;
log_very_verbose("Initialised segtype: %s", segtype->name);
struct lvinfo lvinfo = { .exists = 0 };
struct segment_type _freeseg_type = {
- .cmd = cmd,
.name = "free",
.flags = SEG_VIRTUAL | SEG_CANNOT_BE_ZEROED,
};