1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add the 's' activation mode

Just as 'e' means activation with an exclusive lock,
add an 's' to mean activation with a shared lock.

This allows the existing but implicit behavior of '-ay'
of clvm LVs to be specified explicitly.  For local VGs,
asy simply means ay, just like aey means ay.

For local VGs, ay == aey == asy

For clvm VGs,  ay == asy, aey == aey, asy == asy
This commit is contained in:
David Teigland 2015-06-16 10:18:16 -05:00
parent 1f318dbcee
commit d5adec1056
3 changed files with 11 additions and 2 deletions

View File

@ -953,7 +953,9 @@ exclusive:
if (!activate_lv_excl(cmd, lv))
return_0;
break;
default: /* CHANGE_AY */
case CHANGE_ASY:
case CHANGE_AY:
default:
if (needs_exclusive || _lv_is_exclusive(lv))
goto exclusive;
log_verbose("Activating logical volume \"%s\".", lv->name);

View File

@ -828,7 +828,8 @@ typedef enum activation_change {
CHANGE_AEY = 2, /* activate exclusively */
CHANGE_ALY = 3, /* activate locally */
CHANGE_ALN = 4, /* deactivate locally */
CHANGE_AAY = 5 /* automatic activation */
CHANGE_AAY = 5, /* automatic activation */
CHANGE_ASY = 6 /* activate shared */
} activation_change_t;
/* Returns true, when change activates device */

View File

@ -286,6 +286,12 @@ int activation_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_v
av->ui_value = CHANGE_AEY;
}
else if (!strcmp(av->value, "s") || !strcmp(av->value, "sy") ||
!strcmp(av->value, "ys")) {
av->i_value = CHANGE_ASY;
av->ui_value = CHANGE_ASY;
}
else if (!strcmp(av->value, "y")) {
av->i_value = CHANGE_AY;
av->ui_value = CHANGE_AY;