Skip to contentSkip to conversation

master - thin: add lvchange for discard and zero change

PATCH Zdenek Kabelac 1 participant 1 message Jul 18, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=48367c5be9b39cd118caeb6b8e554be347d2fd8c
Commit:        48367c5be9b39cd118caeb6b8e554be347d2fd8c
Parent:        46b9cc1248941cc43f953e1a6b285ebe64a62077
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Jun 28 14:52:23 2012 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Jul 18 14:38:34 2012 +0200

thin: add lvchange for discard and zero change

Update lvchange to allow change of 'zero' flag for thinpool. Add support for changing discard handling.

N.B. from/to ignore could be only changed for inactive pool.

---
 WHATS_NEW         |    1 +
 man/lvchange.8.in |   14 ++++++++-
 tools/commands.h  |    7 +++-
 tools/lvchange.c  |   88 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 106 insertions(+), 4 deletions(-)
WHATS_NEW +1 -0
index 7811b6d..925ae23 100644
@@ -1,5 +1,6 @@
 Version 2.02.97 - 
 ===============================
+  Support changing of discard and zeroing for thin pool.
   Report used discard for thin pool and volume.
   Add support for controlling discard behavior of thin pool.
   Detect features for new 1.1 thin pool target.
man/lvchange.8.in +13 -1
index bf9ef48..beb77a8 100644
@@ -16,6 +16,8 @@ lvchange \- change attributes of a logical volume
 .RB [ \-d | \-\-debug ]
 .RB [ \-\-deltag
 .IR Tag ]
+.RB [ \-\-discard
+.RI { ignore | nopassdown | passdown }]
 .RB [ \-\-resync ]
 .RB [ \-h | \-? | \-\-help ]
 .RB [ \-\-ignorelockingfailure ]
@@ -37,7 +39,9 @@ lvchange \- change attributes of a logical volume
 .RI { ReadAheadSectors | auto | none }]
 .RB [ \-\-refresh ]
 .RB [ \-t | \-\-test ]
-.RB [ \-v | \-\-verbose]
+.RB [ \-v | \-\-verbose ]
+.RB [ \-Z | \-\-zero
+.RI { y | n }]
 .I LogicalVolumePath
 .RI [ LogicalVolumePath ...]
 .SH DESCRIPTION
@@ -68,6 +72,9 @@ logical volumes. It's only possible to change a non-contiguous
 logical volume's allocation policy to contiguous, if all of the
 allocated physical extents are already contiguous.
 .TP
+.BR \-\-discard " {" \fIignore | \fInopassdown | \fIpassdown }
+Change discard behavior.
+.TP
 .B \-\-resync
 Forces the complete resynchronization of a mirror.  In normal
 circumstances you should not need this option because synchronization
@@ -142,6 +149,11 @@ If the logical volume is active, reload its metadata.
 This is not necessary in normal operation, but may be useful
 if something has gone wrong or if you're doing clustering
 manually without a clustered lock manager.
+.TP
+.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
+Set zeroing mode for thin pool. Note: already provisioned blocks from pool
+in non-zero mode are not cleared in unwritten parts when setting zero to
+\fIy\fP.
 .SH Examples
 Changes the permission on volume lvol1 in volume group vg00 to be read-only:
 .sp
tools/commands.h +5 -2
index fe7403d..88c170a 100644
@@ -69,6 +69,7 @@ xx(lvchange,
    "\t[--deltag Tag]\n"
    "\t[-f|--force]\n"
    "\t[-h|--help]\n"
+   "\t[--discard {ignore|nopassdown|passdown}]\n"
    "\t[--ignorelockingfailure]\n"
    "\t[--ignoremonitoring]\n"
    "\t[--monitor {y|n}]\n"
@@ -84,14 +85,16 @@ xx(lvchange,
    "\t[-t|--test]\n"
    "\t[-v|--verbose]\n"
    "\t[-y|--yes]\n"
-   "\t[--version]" "\n"
+   "\t[--version]\n"
+   "\t[-Z|--zero {y|n}]\n"
    "\tLogicalVolume[Path] [LogicalVolume[Path]...]\n",
 
    alloc_ARG, autobackup_ARG, activate_ARG, available_ARG, contiguous_ARG,
    force_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG, major_ARG,
    minor_ARG, monitor_ARG, noudevsync_ARG, partial_ARG, permission_ARG,
    persistent_ARG, poll_ARG, readahead_ARG, resync_ARG, refresh_ARG,
-   addtag_ARG, deltag_ARG, sysinit_ARG, test_ARG, yes_ARG)
+   addtag_ARG, deltag_ARG, sysinit_ARG, test_ARG, yes_ARG,
+   discard_ARG, zero_ARG)
 
 xx(lvconvert,
    "Change logical volume layout",
tools/lvchange.c +87 -1

112 lines not on this page · raw message