All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Czerner <lczerner@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH v3 05/18] fsadm: Add LVOL_PREFIX configuration option
Date: Tue, 27 Sep 2011 15:42:38 +0200	[thread overview]
Message-ID: <1317130971-24173-6-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1317130971-24173-1-git-send-email-lczerner@redhat.com>

This commit adds new configuration option LVOL_PREFIX which defines a
prefix for new logical volumes. The prefix will be concatenated with a
sequential number of the logical volume.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 scripts/fsadm.sh |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index d1b17e5..d4901d1 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -741,12 +741,10 @@ create() {
 		tmp=$(mktemp)
 		"$LVM" lvs "$vgname" --separator ' ' --noheadings > $tmp
 		for i in $(seq -w $MAX_VGS); do
-			"$GREP" -e " lvol${i} " $tmp &> /dev/null
-			if [ $? -ne 0 ]; then
-				name="lvol${i}"
-				lvname="--name $name"
-				break;
-			fi
+			"$GREP" -e " ${LVOL_PREFIX}${i} " $tmp &> /dev/null && continue
+			name="${LVOL_PREFIX}${i}"
+			lvname="--name $name"
+			break;
 		done
 		rm -f $tmp
 	fi
-- 
1.7.4.4



  parent reply	other threads:[~2011-09-27 13:42 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 13:42 [RFC][PATCH v3 00/16] fsadm update Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 01/18] fsadm: Add new commands create, list, add and remove Lukas Czerner
2011-10-04  9:41   ` Zdenek Kabelac
2011-10-04 12:13     ` Lukas Czerner
2011-10-04 17:09       ` Zdenek Kabelac
2011-10-05  8:02         ` Lukas Czerner
2011-10-05  9:06           ` Zdenek Kabelac
2011-10-05  9:46             ` Lukas Czerner
2011-10-05 10:27               ` Alasdair G Kergon
2011-10-05 11:21                 ` Lukas Czerner
2011-10-05 11:26                   ` Lukas Czerner
2011-10-05 11:28                   ` Ric Wheeler
2011-10-05 11:49                   ` Alasdair G Kergon
2011-10-05 12:15                     ` Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 02/18] fsadm: Make all internal math in kilobytes Lukas Czerner
2011-09-27 15:41   ` Zdenek Kabelac
2011-10-03 16:13     ` Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 03/18] fsadm: Add simple configuration file Lukas Czerner
2011-09-27 15:39   ` Zdenek Kabelac
2011-10-03 16:44     ` Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 04/18] fsadm: Use DEFAULT_DEVICE_POOL when creating volume group Lukas Czerner
2011-09-27 13:42 ` Lukas Czerner [this message]
2011-09-27 13:42 ` [PATCH v3 06/18] fsadm: Fsck extN before resize only if it is not mounted Lukas Czerner
2011-10-04  8:09   ` Zdenek Kabelac
2011-09-27 13:42 ` [PATCH v3 07/18] fsadm: Only use readlink if link is provided Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 08/18] fsadm: Remove unnecessary modification of PATH variable Lukas Czerner
2011-10-04  8:12   ` Zdenek Kabelac
2011-10-04  8:17     ` Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 09/18] fsadm: Allow to specify lv in vg/lv format Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 10/18] fsadm: Umount ext2 file system prior resize Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 11/18] fsadm: Add help for new commands and update man page Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 12/18] lvresize: Specify --resize-fs-only when going to use fsadm resize Lukas Czerner
2011-09-27 15:44   ` Zdenek Kabelac
2011-10-03 16:20     ` Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 13/18] fsadm: remove -y (YES) option Lukas Czerner
2011-09-27 15:38   ` Zdenek Kabelac
2011-10-03 16:39     ` Lukas Czerner
2011-10-03 18:18       ` Zdenek Kabelac
2011-10-04  6:29         ` Lukas Czerner
2011-10-04  8:07           ` Zdenek Kabelac
2011-09-27 13:42 ` [PATCH v3 14/18] test: add helper to compute aligned lv size Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 15/18] test: Add test for fsadm add command Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 16/18] test: Add test for fsadm create command Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 17/18] test: Add test for fsadm resize command Lukas Czerner
2011-09-27 13:42 ` [PATCH v3 18/18] test: Add test for fsadm remove command Lukas Czerner
2011-09-27 13:50 ` [RFC][PATCH v3 00/16] fsadm update Lukas Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317130971-24173-6-git-send-email-lczerner@redhat.com \
    --to=lczerner@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.