summaryrefslogtreecommitdiffstats
path: root/tools/lvchange.c
diff options
context:
space:
mode:
authorDave Wysochanski <dwysocha@redhat.com>2010-02-24 18:15:49 +0000
committerDave Wysochanski <dwysocha@redhat.com>2010-02-24 18:15:49 +0000
commitcd69ee74535333f8d4ae7141e42b76a89fcfcb31 (patch)
tree7031fcee4e6f7069c8d76cc0155d6b887dd7ca8c /tools/lvchange.c
parentaee205752abdd9d05e67b953c2bc1f5d626dd808 (diff)
downloadlvm2-cd69ee74535333f8d4ae7141e42b76a89fcfcb31.tar.gz
lvm2-cd69ee74535333f8d4ae7141e42b76a89fcfcb31.tar.xz
lvm2-cd69ee74535333f8d4ae7141e42b76a89fcfcb31.zip
Refactor lvchange_tag() to call lv_change_tag() library function.
Similar refactoring to vgchange - pull out common parts and put into library function for reuse. Should be no functional change. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Diffstat (limited to 'tools/lvchange.c')
-rw-r--r--tools/lvchange.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 5118e510..2d7955e8 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -500,25 +500,8 @@ static int lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv,
return 0;
}
- if (!(lv->vg->fid->fmt->features & FMT_TAGS)) {
- log_error("Logical volume %s/%s does not support tags",
- lv->vg->name, lv->name);
- return 0;
- }
-
- if ((arg == addtag_ARG)) {
- if (!str_list_add(cmd->mem, &lv->tags, tag)) {
- log_error("Failed to add tag %s to %s/%s",
- tag, lv->vg->name, lv->name);
- return 0;
- }
- } else {
- if (!str_list_del(&lv->tags, tag)) {
- log_error("Failed to remove tag %s from %s/%s",
- tag, lv->vg->name, lv->name);
- return 0;
- }
- }
+ if (!lv_change_tag(lv, tag, arg == addtag_ARG))
+ return_0;
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);