summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-08-09 12:20:47 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-09 16:25:52 +0200
commit54c24193f535660478e88af76340eef40dc3223c (patch)
tree8b3b712342c1d1cc5d484f759d54b83dfdf428e8 /tools
parent80bf4eb03546903d88affbb866c9c3750bfa08e5 (diff)
downloadlvm2-54c24193f535660478e88af76340eef40dc3223c.tar.gz
lvm2-54c24193f535660478e88af76340eef40dc3223c.tar.xz
lvm2-54c24193f535660478e88af76340eef40dc3223c.zip
thin: lvcreate --discards
Diffstat (limited to 'tools')
-rw-r--r--tools/commands.h6
-rw-r--r--tools/lvcreate.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/tools/commands.h b/tools/commands.h
index 2a4404ea..602fe81e 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -180,6 +180,10 @@ xx(lvcreate,
"\t[-p|--permission {r|rw}]\n"
"\t[-r|--readahead ReadAheadSectors|auto|none]\n"
"\t[-R|--regionsize MirrorLogRegionSize]\n"
+ "\t[-T|--thin [-c|--chunksize ChunkSize]\n"
+ "\t [--discards {ignore|nopassdown|passdown}]\n"
+ "\t [--poolmetadatasize MetadataSize[bBsSkKmMgG]]]\n"
+ "\t[--thinpool ThinPoolLogicalVolume{Name|Path}]\n"
"\t[-t|--test]\n"
"\t[--type VolumeType]\n"
"\t[-v|--verbose]\n"
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index da2b925e..6aecf1d0 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -797,6 +797,13 @@ static int _lvcreate_params(struct lvcreate_params *lp,
!_read_raid_params(lp, cmd))
return_0;
+ if (lp->create_thin_pool) {
+ lp->discards = arg_uint_value(cmd, discards_ARG, THIN_DISCARDS_PASSDOWN);
+ } else if (arg_count(cmd, discards_ARG)) {
+ log_error("--discards is only available for thin pool creation.");
+ return 0;
+ }
+
if (lp->snapshot && lp->thin && arg_count(cmd, chunksize_ARG))
log_warn("WARNING: Ignoring --chunksize with thin snapshots.");
else if (lp->thin && !lp->create_thin_pool) {