master - thin: fix recent commits
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7ecccc3099c854...
Commit: 7ecccc3099c854bd9a993b360974a9f52a746131
Parent: 701b4a8363417b7d72a7255ca663991f3be95859
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 21:59:06 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 21:59:06 2012 +0100
thin: fix recent commits
---
lib/thin/thin.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 5a044ee..cfd50ad 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -115,7 +115,7 @@ static int _thin_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("Could not read chunk_size");
if (dm_config_has_node(sn, "discards") &&
- !dm_config_get_str(sn, "discards", &discard_str))
+ !dm_config_get_str(sn, "discards", &discards_str))
return SEG_LOG_ERROR("Could not read discards for");
if (!discards_str)
@@ -276,16 +276,15 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
seg->zero_new_blocks ? 0 : 1))
return_0;
- if (seg->discards != THIN_DISCARDS_PASSDOWN)
- if (attr & THIN_FEATURE_DISCARDS) {
- /* FIXME: Check whether underlying dev supports discards */
- if (!dm_tree_node_set_thin_pool_discard(node,
- seg->discards == THIN_DISCARDS_IGNORE,
- seg->discards == THIN_DISCARDS_NO_PASSDOWN))
- return_0;
- } else
- log_warn_suppress(_no_discards++, "WARNING: Thin pool target does "
- "not support discards (needs kernel >= 3.4).");
+ if ((seg->discards != THIN_DISCARDS_PASSDOWN) && (attr & THIN_FEATURE_DISCARDS)) {
+ /* FIXME: Check whether underlying dev supports discards */
+ if (!dm_tree_node_set_thin_pool_discard(node,
+ seg->discards == THIN_DISCARDS_IGNORE,
+ seg->discards == THIN_DISCARDS_NO_PASSDOWN))
+ return_0;
+ } else
+ log_warn_suppress(_no_discards++, "WARNING: Thin pool target does "
+ "not support discards (needs kernel >= 3.4).");
/*
* Add messages only for activation tree.
11 years, 8 months
master - thin: use discards as plural rather than singular
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=701b4a8363417b...
Commit: 701b4a8363417b7d72a7255ca663991f3be95859
Parent: df452b47a1ae0288e737cfcdc171f8fe31e4a876
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 21:24:41 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 21:24:41 2012 +0100
thin: use discards as plural rather than singular
Global change from --discard to --discards, as that feels more natural.
---
WHATS_NEW | 4 +-
WHATS_NEW_DM | 2 +-
lib/activate/activate.h | 2 +-
lib/metadata/metadata-exported.h | 14 +++++-----
lib/metadata/thin_manip.c | 22 +++++++++---------
lib/report/columns.h | 2 +-
lib/report/properties.c | 4 +-
lib/report/report.c | 12 +++++-----
lib/thin/thin.c | 46 +++++++++++++++++++-------------------
libdm/libdevmapper.h | 4 +-
man/lvchange.8.in | 10 ++++----
man/lvcreate.8.in | 6 ++--
tools/args.h | 2 +-
tools/commands.h | 8 +++---
tools/lvchange.c | 28 +++++++++++-----------
tools/lvmcmdline.c | 10 ++++----
tools/tools.h | 2 +-
17 files changed, 89 insertions(+), 89 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 97f3150..25f4a9c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -11,9 +11,9 @@ Version 2.02.97 - 7th August 2012
Recognise Micron PCIe SSDs in filter and move array out to device-types.h.
Fix dumpconfig <node> to print only <node> without its siblings. (2.02.89)
Do not issue "Failed to handle a client connection" error if lvmetad killed.
- Support lvchange --discard and -Z with thin pools.
+ Support lvchange --discards and -Z with thin pools.
Add discard LV segment field to reports.
- Add --discard to lvcreate --thin.
+ Add --discards to lvcreate --thin.
Set discard and external snapshot features if thin pool target is vsn 1.1+.
Count percentage of completeness upwards not downwards when merging snapshot.
Skip activation when using vg/lvchange --sysinit -a ay and lvmetad is active.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index b18c10c..3890ea4 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -4,7 +4,7 @@ Version 1.02.76 - 7th August 2012
Allow --noflush with dmsetup status and wait (for thin target).
Add dm_config_write_one_node to libdevmapper.
Support thin pool message release/reserve_metadata_snap in libdevmapper.
- Support thin pool discard and external origin features in libdevmapper.
+ Support thin pool discards and external origin features in libdevmapper.
Add configure --enable-udev-rule-exec-detection to detect exec path in rules.
Use sbindir in udev rules by default and remove executable path detection.
Remove hard-coded paths for dmeventd fifos and use default-dm-run-dir.
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index 6497eea..ba24d2a 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -47,7 +47,7 @@ struct lv_activate_opts {
/* thin target attribute flags */
enum {
/* bitfields - new features from 1.1 version */
- THIN_FEATURE_DISCARD = (1 << 0),
+ THIN_FEATURE_DISCARDS = (1 << 0),
THIN_FEATURE_EXTERNAL_ORIGIN = (1 << 1),
THIN_FEATURE_HELD_ROOT = (1 << 2),
THIN_FEATURE_BLOCK_SIZE = (1 << 3),
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 35ffa93..74edb58 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -167,10 +167,10 @@ typedef enum {
} force_t;
typedef enum {
- THIN_DISCARD_IGNORE,
- THIN_DISCARD_NO_PASSDOWN,
- THIN_DISCARD_PASSDOWN,
-} thin_discard_t;
+ THIN_DISCARDS_IGNORE,
+ THIN_DISCARDS_NO_PASSDOWN,
+ THIN_DISCARDS_PASSDOWN,
+} thin_discards_t;
struct cmd_context;
struct format_handler;
@@ -353,7 +353,7 @@ struct lv_segment {
uint64_t transaction_id; /* For thin_pool, thin */
uint64_t low_water_mark; /* For thin_pool */
unsigned zero_new_blocks; /* For thin_pool */
- thin_discard_t discard; /* For thin_pool */
+ thin_discards_t discards; /* For thin_pool */
struct dm_list thin_messages; /* For thin_pool */
struct logical_volume *pool_lv; /* For thin */
uint32_t device_id; /* For thin, 24bit */
@@ -565,8 +565,8 @@ uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
uint32_t extent_size);
int update_pool_lv(struct logical_volume *lv, int activate);
-int get_pool_discard(const char *str, thin_discard_t *discard);
-const char *get_pool_discard_name(thin_discard_t discard);
+int get_pool_discards(const char *str, thin_discards_t *discards);
+const char *get_pool_discards_name(thin_discards_t discards);
/*
* Activation options
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 0395b48..c1fa8b2 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -429,34 +429,34 @@ int update_pool_lv(struct logical_volume *lv, int activate)
return 1;
}
-int get_pool_discard(const char *str, thin_discard_t *discard)
+int get_pool_discards(const char *str, thin_discards_t *discards)
{
if (!strcasecmp(str, "passdown"))
- *discard = THIN_DISCARD_PASSDOWN;
+ *discards = THIN_DISCARDS_PASSDOWN;
else if (!strcasecmp(str, "nopassdown"))
- *discard = THIN_DISCARD_NO_PASSDOWN;
+ *discards = THIN_DISCARDS_NO_PASSDOWN;
else if (!strcasecmp(str, "ignore"))
- *discard = THIN_DISCARD_IGNORE;
+ *discards = THIN_DISCARDS_IGNORE;
else {
- log_error("Thin pool discard type %s is unknown.", str);
+ log_error("Thin pool discards type %s is unknown.", str);
return 0;
}
return 1;
}
-const char *get_pool_discard_name(thin_discard_t discard)
+const char *get_pool_discards_name(thin_discards_t discards)
{
- switch (discard) {
- case THIN_DISCARD_PASSDOWN:
+ switch (discards) {
+ case THIN_DISCARDS_PASSDOWN:
return "passdown";
- case THIN_DISCARD_NO_PASSDOWN:
+ case THIN_DISCARDS_NO_PASSDOWN:
return "nopassdown";
- case THIN_DISCARD_IGNORE:
+ case THIN_DISCARDS_IGNORE:
return "ignore";
}
- log_error(INTERNAL_ERROR "Uknown discard type encountered.");
+ log_error(INTERNAL_ERROR "Uknown discards type encountered.");
return "unknown";
}
diff --git a/lib/report/columns.h b/lib/report/columns.h
index c869d14..6299a2b 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -140,7 +140,7 @@ FIELD(SEGS, seg, NUM, "Region", region_size, 6, size32, region_size, "For mirror
FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, chunksize, "For snapshots, the unit of data used when tracking changes.", 0)
FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, chunk_size, "For snapshots, the unit of data used when tracking changes.", 0)
FIELD(SEGS, seg, NUM, "#Thins", list, 4, thincount, thin_count, "For thin pools, the number of thin volumes in this pool.", 0)
-FIELD(SEGS, seg, NUM, "Discard", list, 7, discard, discard, "For thin pools, how discards are handled.", 0)
+FIELD(SEGS, seg, NUM, "Discards", list, 8, discards, discards, "For thin pools, how discards are handled.", 0)
FIELD(SEGS, seg, NUM, "Zero", list, 4, thinzero, zero, "For thin pools, if zeroing is enabled.", 0)
FIELD(SEGS, seg, NUM, "TransId", list, 4, transactionid, transaction_id, "For thin pools, the transaction id.", 0)
FIELD(SEGS, seg, NUM, "Start", list, 5, segstart, seg_start, "Offset within the LV to the start of the segment in current units.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index d78ad64..d2eac5e 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -277,8 +277,8 @@ GET_LVSEG_NUM_PROPERTY_FN(zero, lvseg->zero_new_blocks)
#define _zero_set _not_implemented_set
GET_LVSEG_NUM_PROPERTY_FN(transaction_id, lvseg->transaction_id)
#define _transaction_id_set _not_implemented_set
-GET_LVSEG_NUM_PROPERTY_FN(discard, lvseg->discard)
-#define _discard_set _not_implemented_set
+GET_LVSEG_NUM_PROPERTY_FN(discards, lvseg->discards)
+#define _discards_set _not_implemented_set
GET_LVSEG_NUM_PROPERTY_FN(seg_start, lvseg_start(lvseg))
#define _seg_start_set _not_implemented_set
GET_LVSEG_NUM_PROPERTY_FN(seg_start_pe, lvseg->le)
diff --git a/lib/report/report.c b/lib/report/report.c
index b66be4f..a8553d2 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -564,19 +564,19 @@ static int _transactionid_disp(struct dm_report *rh, struct dm_pool *mem,
return dm_report_field_uint64(rh, field, &seg->transaction_id);
}
-static int _discard_disp(struct dm_report *rh, struct dm_pool *mem,
- struct dm_report_field *field,
- const void *data, void *private)
+static int _discards_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data, void *private)
{
const struct lv_segment *seg = (const struct lv_segment *) data;
- const char *discard_str;
+ const char *discards_str;
if (seg_is_thin_volume(seg))
seg = first_seg(seg->pool_lv);
if (seg_is_thin_pool(seg)) {
- discard_str = get_pool_discard_name(seg->discard);
- return dm_report_field_string(rh, field, &discard_str);
+ discards_str = get_pool_discards_name(seg->discards);
+ return dm_report_field_string(rh, field, &discards_str);
}
dm_report_field_set_value(field, "", NULL);
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 3e562ef..5a044ee 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -87,7 +87,7 @@ static int _thin_pool_text_import(struct lv_segment *seg,
{
const char *lv_name;
struct logical_volume *pool_data_lv, *pool_metadata_lv;
- const char *discard_str = NULL;
+ const char *discards_str = NULL;
if (!dm_config_get_str(sn, "metadata", &lv_name))
return SEG_LOG_ERROR("Metadata must be a string in");
@@ -114,14 +114,14 @@ static int _thin_pool_text_import(struct lv_segment *seg,
if (!dm_config_get_uint32(sn, "chunk_size", &seg->chunk_size))
return SEG_LOG_ERROR("Could not read chunk_size");
- if (dm_config_has_node(sn, "discard") &&
- !dm_config_get_str(sn, "discard", &discard_str))
- return SEG_LOG_ERROR("Could not read discard for");
+ if (dm_config_has_node(sn, "discards") &&
+ !dm_config_get_str(sn, "discards", &discard_str))
+ return SEG_LOG_ERROR("Could not read discards for");
- if (!discard_str)
- seg->discard = THIN_DISCARD_PASSDOWN;
- else if (!get_pool_discard(discard_str, &seg->discard))
- return SEG_LOG_ERROR("Discard option unsupported for");
+ if (!discards_str)
+ seg->discards = THIN_DISCARDS_PASSDOWN;
+ else if (!get_pool_discards(discards_str, &seg->discards))
+ return SEG_LOG_ERROR("Discards option unsupported for");
if (dm_config_has_node(sn, "low_water_mark") &&
!dm_config_get_uint64(sn, "low_water_mark", &seg->low_water_mark))
@@ -163,14 +163,14 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter
outsize(f, (uint64_t) seg->chunk_size,
"chunk_size = %u", seg->chunk_size);
- switch (seg->discard) {
- case THIN_DISCARD_PASSDOWN:
- case THIN_DISCARD_NO_PASSDOWN:
- case THIN_DISCARD_IGNORE:
- outf(f, "discard = \"%s\"", get_pool_discard_name(seg->discard));
+ switch (seg->discards) {
+ case THIN_DISCARDS_PASSDOWN:
+ case THIN_DISCARDS_NO_PASSDOWN:
+ case THIN_DISCARDS_IGNORE:
+ outf(f, "discards = \"%s\"", get_pool_discards_name(seg->discards));
break;
default:
- log_error(INTERNAL_ERROR "Invalid discard value %d.", seg->discard);
+ log_error(INTERNAL_ERROR "Invalid discards value %d.", seg->discards);
return 0;
}
@@ -232,7 +232,7 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
struct dm_tree_node *node, uint64_t len,
uint32_t *pvmove_mirror_count __attribute__((unused)))
{
- static int _no_discard = 0;
+ static int _no_discards = 0;
char *metadata_dlid, *pool_dlid;
const struct lv_thin_message *lmsg;
const struct logical_volume *origin;
@@ -276,16 +276,16 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
seg->zero_new_blocks ? 0 : 1))
return_0;
- if (seg->discard != THIN_DISCARD_PASSDOWN)
- if (attr & THIN_FEATURE_DISCARD) {
- /* FIXME: Check whether underlying dev supports discard */
+ if (seg->discards != THIN_DISCARDS_PASSDOWN)
+ if (attr & THIN_FEATURE_DISCARDS) {
+ /* FIXME: Check whether underlying dev supports discards */
if (!dm_tree_node_set_thin_pool_discard(node,
- seg->discard == THIN_DISCARD_IGNORE,
- seg->discard == THIN_DISCARD_NO_PASSDOWN))
+ seg->discards == THIN_DISCARDS_IGNORE,
+ seg->discards == THIN_DISCARDS_NO_PASSDOWN))
return_0;
} else
- log_warn_suppress(_no_discard++, "WARNING: Thin pool target does "
- "not support discard (needs kernel >= 3.4).");
+ log_warn_suppress(_no_discards++, "WARNING: Thin pool target does "
+ "not support discards (needs kernel >= 3.4).");
/*
* Add messages only for activation tree.
@@ -544,7 +544,7 @@ static int _thin_target_present(struct cmd_context *cmd,
}
if (maj >=1 && min >= 1)
- _attrs |= THIN_FEATURE_DISCARD;
+ _attrs |= THIN_FEATURE_DISCARDS;
else
/* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
log_debug("Target " THIN_MODULE " does not support discards.");
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 28685b2..6d24102 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -660,8 +660,8 @@ int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
/*
* Set thin pool discard features
- * ignore - Disable discard support
- * no_passdown - Don't pass discard down to underlaying data device,
+ * ignore - Disable support for discards
+ * no_passdown - Don't pass discards down to underlying data device,
* just remove the mapping
* Feature is available since version 1.1 of the thin target.
*/
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index e58d79c..32a0580 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -16,7 +16,7 @@ lvchange \- change attributes of a logical volume
.RB [ \-d | \-\-debug ]
.RB [ \-\-deltag
.IR Tag ]
-.RB [ \-\-discard
+.RB [ \-\-discards
.RI { ignore | nopassdown | passdown }]
.RB [ \-\-resync ]
.RB [ \-h | \-? | \-\-help ]
@@ -72,13 +72,13 @@ 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 }
+.BR \-\-discards " {" \fIignore | \fInopassdown | \fIpassdown }
Set this to \fIignore\fP to ignore any discards received by a
thin pool Logical Volume. Set to \fInopassdown\fP to process such
discards within the thin pool itself and allow the no-longer-needed
-extents to be overwritten by new data. Set to \fIpassdown\fP to
-process them both within the thin pool itself and to pass them down
-the underlying device.
+extents to be overwritten by new data. Set to \fIpassdown\fP (the
+default) to process them both within the thin pool itself and to
+pass them down the underlying device.
.TP
.B \-\-resync
Forces the complete resynchronization of a mirror. In normal
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 1911605..a87136a 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -54,7 +54,7 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-T | \-\-thin
.RB [ \-c | \-\-chunksize
.IR ChunkSize ]
-.RB [ \-\-discard
+.RB [ \-\-discards
.RI { ignore | nopassdown | passdown }]
.RB [ \-\-poolmetadatasize
.IR MetadataSize [ bBsSkKmMgG ]]]
@@ -140,8 +140,8 @@ Sets or resets the contiguous allocation policy for
logical volumes. Default is no contiguous allocation based
on a next free principle.
.TP
-.BR \-\-discard " {" \fIignore | \fInopassdown | \fIpassdown }
-Set discard behavior.
+.BR \-\-discards " {" \fIignore | \fInopassdown | \fIpassdown }
+Set discards behavior.
Default is \fIpassdown\fP.
.TP
.BR \-i ", " \-\-stripes " " \fIStripes
diff --git a/tools/args.h b/tools/args.h
index b195303..796fc51 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -72,7 +72,7 @@ arg(virtualoriginsize_ARG, '\0', "virtualoriginsize", size_mb_arg, 0)
arg(noudevsync_ARG, '\0', "noudevsync", NULL, 0)
arg(poll_ARG, '\0', "poll", yes_no_arg, 0)
arg(poolmetadatasize_ARG, '\0', "poolmetadatasize", size_mb_arg, 0)
-arg(discard_ARG, '\0', "discard", discard_arg, 0)
+arg(discards_ARG, '\0', "discards", discards_arg, 0)
arg(stripes_long_ARG, '\0', "stripes", int_arg, 0)
arg(sysinit_ARG, '\0', "sysinit", NULL, 0)
arg(thinpool_ARG, '\0', "thinpool", string_arg, 0)
diff --git a/tools/commands.h b/tools/commands.h
index 47b540e..2a4404e 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -69,7 +69,7 @@ xx(lvchange,
"\t[--deltag Tag]\n"
"\t[-f|--force]\n"
"\t[-h|--help]\n"
- "\t[--discard {ignore|nopassdown|passdown}]\n"
+ "\t[--discards {ignore|nopassdown|passdown}]\n"
"\t[--ignorelockingfailure]\n"
"\t[--ignoremonitoring]\n"
"\t[--monitor {y|n}]\n"
@@ -90,7 +90,7 @@ xx(lvchange,
"\tLogicalVolume[Path] [LogicalVolume[Path]...]\n",
alloc_ARG, autobackup_ARG, activate_ARG, available_ARG, contiguous_ARG,
- discard_ARG, force_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG,
+ discards_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,
@@ -198,7 +198,7 @@ xx(lvcreate,
"\t[--alloc AllocationPolicy]\n"
"\t[-C|--contiguous {y|n}]\n"
"\t[-d|--debug]\n"
- "\t[--discard {ignore|nopassdown|passdown}]\n"
+ "\t[--discards {ignore|nopassdown|passdown}]\n"
"\t[-h|-?|--help]\n"
"\t[--ignoremonitoring]\n"
"\t[--monitor {y|n}]\n"
@@ -219,7 +219,7 @@ xx(lvcreate,
"\t[PhysicalVolumePath...]\n\n",
addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
- chunksize_ARG, contiguous_ARG, corelog_ARG, discard_ARG, extents_ARG,
+ chunksize_ARG, contiguous_ARG, corelog_ARG, discards_ARG, extents_ARG,
ignoremonitoring_ARG, major_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG,
monitor_ARG, name_ARG, nosync_ARG, noudevsync_ARG, permission_ARG,
persistent_ARG, readahead_ARG, regionsize_ARG, size_ARG, snapshot_ARG,
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 1a4318f..a0c4a01 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -95,28 +95,28 @@ static int lvchange_pool_update(struct cmd_context *cmd,
int r = 0;
int update = 0;
unsigned val;
- thin_discard_t discard;
+ thin_discards_t discards;
if (!lv_is_thin_pool(lv)) {
log_error("Logical volume \"%s\" is not a thin pool.", lv->name);
return 0;
}
- if (arg_count(cmd, discard_ARG)) {
- discard = arg_uint_value(cmd, discard_ARG, 0);
- if (discard != first_seg(lv)->discard) {
- if (((discard == THIN_DISCARD_IGNORE) ||
- (first_seg(lv)->discard == THIN_DISCARD_IGNORE)) &&
+ if (arg_count(cmd, discards_ARG)) {
+ discards = arg_uint_value(cmd, discards_ARG, 0);
+ if (discards != first_seg(lv)->discards) {
+ if (((discards == THIN_DISCARDS_IGNORE) ||
+ (first_seg(lv)->discards == THIN_DISCARDS_IGNORE)) &&
lv_is_active(lv))
- log_error("Cannot change discard state for active "
+ log_error("Cannot change discards state for active "
"logical volume \"%s\".", lv->name);
else {
- first_seg(lv)->discard = discard;
+ first_seg(lv)->discards = discards;
update++;
}
} else
- log_error("Logical volume \"%s\" already uses discard %s.",
- lv->name, get_pool_discard_name(discard));
+ log_error("Logical volume \"%s\" already uses --discards %s.",
+ lv->name, get_pool_discards_name(discards));
}
if (arg_count(cmd, zero_ARG)) {
@@ -623,7 +623,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
if (!(lv->vg->status & LVM_WRITE) &&
(arg_count(cmd, contiguous_ARG) || arg_count(cmd, permission_ARG) ||
arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG) ||
- arg_count(cmd, discard_ARG) ||
+ arg_count(cmd, discards_ARG) ||
arg_count(cmd, zero_ARG) ||
arg_count(cmd, alloc_ARG))) {
log_error("Only -a permitted with read-only volume "
@@ -750,7 +750,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
}
}
- if (arg_count(cmd, discard_ARG) ||
+ if (arg_count(cmd, discards_ARG) ||
arg_count(cmd, zero_ARG)) {
if (!archived && !archive(lv->vg)) {
stack;
@@ -839,14 +839,14 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG) ||
arg_count(cmd, addtag_ARG) || arg_count(cmd, deltag_ARG) ||
arg_count(cmd, resync_ARG) || arg_count(cmd, alloc_ARG) ||
- arg_count(cmd, discard_ARG) || arg_count(cmd, zero_ARG);
+ arg_count(cmd, discards_ARG) || arg_count(cmd, zero_ARG);
if (!update &&
!arg_count(cmd, activate_ARG) && !arg_count(cmd, refresh_ARG) &&
!arg_count(cmd, monitor_ARG) && !arg_count(cmd, poll_ARG)) {
log_error("Need 1 or more of -a, -C, -M, -p, -r, -Z, "
"--resync, --refresh, --alloc, --addtag, --deltag, "
- "--monitor, --poll or --discard");
+ "--monitor, --poll or --discards");
return EINVALID_CMD_LINE;
}
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 50a2ac1..9964817 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -216,15 +216,15 @@ int activation_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_v
return 1;
}
-int discard_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_values *av)
+int discards_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_values *av)
{
- thin_discard_t discard;
+ thin_discards_t discards;
- if (!get_pool_discard(av->value, &discard))
+ if (!get_pool_discards(av->value, &discards))
return_0;
- av->i_value = discard;
- av->ui_value = discard;
+ av->i_value = discards;
+ av->ui_value = discards;
return 1;
}
diff --git a/tools/tools.h b/tools/tools.h
index 4d2f5b0..a3ad9fd 100644
--- a/tools/tools.h
+++ b/tools/tools.h
@@ -139,7 +139,7 @@ void usage(const char *name);
/* the argument verify/normalise functions */
int yes_no_arg(struct cmd_context *cmd, struct arg_values *av);
int activation_arg(struct cmd_context *cmd, struct arg_values *av);
-int discard_arg(struct cmd_context *cmd, struct arg_values *av);
+int discards_arg(struct cmd_context *cmd, struct arg_values *av);
int size_kb_arg(struct cmd_context *cmd, struct arg_values *av);
int size_mb_arg(struct cmd_context *cmd, struct arg_values *av);
int int_arg(struct cmd_context *cmd, struct arg_values *av);
11 years, 8 months
master - release: update version/WHATS_NEW
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df452b47a1ae02...
Commit: df452b47a1ae0288e737cfcdc171f8fe31e4a876
Parent: 3a6bea990b01a583de830b90fee492823139b7ea
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 20:41:45 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 20:41:45 2012 +0100
release: update version/WHATS_NEW
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 30 +++++++++++++-----------------
WHATS_NEW_DM | 13 +++++++++----
4 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/VERSION b/VERSION
index 8b62010..159419f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.97(2)-git (2012-07-29)
+2.02.97(2)-git (2012-08-07)
diff --git a/VERSION_DM b/VERSION_DM
index e01aaa7..6b6b104 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.76-git (2012-07-30)
+1.02.76-git (2012-08-07)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2c4d139..97f3150 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,22 +1,21 @@
-Version 2.02.97 -
-===============================
+Version 2.02.97 - 7th August 2012
+=================================
Improve documention of allocation policies in lvm.8.
Increase limit for major:minor to 4095:1048575 when using -My option.
Add make install_systemd_generators.
Add generator for lvm2 activation systemd units.
Add lvm_config_find_bool lvm2app fn to retrieve bool value from config tree.
- Respect --test also when using lvmetad.
+ Respect --test when using lvmetad.
No longer capitalise first LV attribute char for invalid snapshots.
Allow vgextend to add PVs to a VG that is missing PVs.
Recognise Micron PCIe SSDs in filter and move array out to device-types.h.
- Fix segfault when attempting to replace RAID 4/5/6 device (2.02.97).
- Fix dumpconfig <node> to print only <node> without its siblings (2.02.89).
+ Fix dumpconfig <node> to print only <node> without its siblings. (2.02.89)
Do not issue "Failed to handle a client connection" error if lvmetad killed.
- 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.
- Count percentage of completeness upwards when merging a snapshot volume.
+ Support lvchange --discard and -Z with thin pools.
+ Add discard LV segment field to reports.
+ Add --discard to lvcreate --thin.
+ Set discard and external snapshot features if thin pool target is vsn 1.1+.
+ Count percentage of completeness upwards not downwards when merging snapshot.
Skip activation when using vg/lvchange --sysinit -a ay and lvmetad is active.
Fix extending RAID 4/5/6 logical volumes
Fix test for PV with unknown VG in process_each_pv to ignore ignored mdas.
@@ -29,13 +28,10 @@ Version 2.02.97 -
Add --activate synonym for --available arg and prefer --activate.
Never issue discards when LV extents are being reconfigured, not deleted.
Allow release_lv_segment_area to fail as functions it calls can fail.
- Open device read-only to obtain readahead value.
- Fix lvconvert error path NULL pointer dereference.
- Check for create_instance() fail in pvscan_lvmetad_single().
- Use 64bit math for reserved memory and stack.
- Add tests for kernel_send() errors in cmirrod.
- Print clean_bits in pull_state, fix cut&paste typo in cmirrord.
- Add tests for errors from closedir(), close() in cmirrord.
+ Open device read-only instead of read-write when obtaining readahead value.
+ Fix lvconvert thin pool error path NULL pointer dereference.
+ Detect create_instance() failure in pvscan_lvmetad_single().
+ Use 64-bit calculations for reserved memory and stack.
Fix missing sync of filesystem when creating thin volume snapshot.
Version 2.02.96 - 8th June 2012
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index a790ccf..b18c10c 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,15 +1,20 @@
-Version 1.02.76 -
-===============================
+Version 1.02.76 - 7th August 2012
+=================================
+ Add dm_vasprintf to libdevmapper.
Allow --noflush with dmsetup status and wait (for thin target).
Add dm_config_write_one_node to libdevmapper.
- Add support for thin pool message release/reserve_metadata_snap.
- Add support for thin pool discard and external origin.
+ Support thin pool message release/reserve_metadata_snap in libdevmapper.
+ Support thin pool discard and external origin features in libdevmapper.
Add configure --enable-udev-rule-exec-detection to detect exec path in rules.
Use sbindir in udev rules by default and remove executable path detection.
Remove hard-coded paths for dmeventd fifos and use default-dm-run-dir.
Add configure --with-lvmetad-pidfile to remove hard-coded value.
Add configure --with-default-pid-dir for common directory with pid files.
Add configure --with-default-dm-run-dir to set run directory for dm tools.
+ Detect kernel_send() errors in cmirrord.
+ Add __attribute__ instrumentation to libdevmapper.h.
+ Print clean_bits instead of sync_bits in pull_state in cmirrord.
+ Add tests for errors from closedir(), close() in cmirrord.
Add documentation references in systemd units.
Remove veritysetup. Now maintained with cryptsetup.
11 years, 8 months
master - thin: tidy thin discard code
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3a6bea990b01a5...
Commit: 3a6bea990b01a583de830b90fee492823139b7ea
Parent: 597590da7412485ccdcb71ca909fbc5f73ec2aa1
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 20:40:19 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 20:40:19 2012 +0100
thin: tidy thin discard code
Always store discard setting in LV metadata. (Note that lvcreate_params
doesn't yet use --discard to set the initial value.)
Remove undocumented env var LVM_THIN_VERSION_MIN that has no use on a
live system.
Change verbose 'feature not found' messages to debug.
Use discard_str for string value of discard.
---
lib/thin/thin.c | 35 +++++++++++++----------------------
1 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/lib/thin/thin.c b/lib/thin/thin.c
index 27ce6f5..3e562ef 100644
--- a/lib/thin/thin.c
+++ b/lib/thin/thin.c
@@ -87,7 +87,7 @@ static int _thin_pool_text_import(struct lv_segment *seg,
{
const char *lv_name;
struct logical_volume *pool_data_lv, *pool_metadata_lv;
- const char *discard = NULL;
+ const char *discard_str = NULL;
if (!dm_config_get_str(sn, "metadata", &lv_name))
return SEG_LOG_ERROR("Metadata must be a string in");
@@ -115,12 +115,12 @@ static int _thin_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("Could not read chunk_size");
if (dm_config_has_node(sn, "discard") &&
- !dm_config_get_str(sn, "discard", &discard))
+ !dm_config_get_str(sn, "discard", &discard_str))
return SEG_LOG_ERROR("Could not read discard for");
- if (!discard)
+ if (!discard_str)
seg->discard = THIN_DISCARD_PASSDOWN;
- else if (!get_pool_discard(discard, &seg->discard))
+ else if (!get_pool_discard(discard_str, &seg->discard))
return SEG_LOG_ERROR("Discard option unsupported for");
if (dm_config_has_node(sn, "low_water_mark") &&
@@ -165,14 +165,12 @@ static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter
switch (seg->discard) {
case THIN_DISCARD_PASSDOWN:
- /* nothing to do */
- break;
case THIN_DISCARD_NO_PASSDOWN:
case THIN_DISCARD_IGNORE:
outf(f, "discard = \"%s\"", get_pool_discard_name(seg->discard));
break;
default:
- log_error(INTERNAL_ERROR "Unexportable discard.");
+ log_error(INTERNAL_ERROR "Invalid discard value %d.", seg->discard);
return 0;
}
@@ -278,9 +276,9 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
seg->zero_new_blocks ? 0 : 1))
return_0;
- if (seg->discard != THIN_DISCARD_PASSDOWN) {
+ if (seg->discard != THIN_DISCARD_PASSDOWN)
if (attr & THIN_FEATURE_DISCARD) {
- /* FIXME: Check whether underlaying dev supports discard */
+ /* FIXME: Check whether underlying dev supports discard */
if (!dm_tree_node_set_thin_pool_discard(node,
seg->discard == THIN_DISCARD_IGNORE,
seg->discard == THIN_DISCARD_NO_PASSDOWN))
@@ -288,7 +286,6 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
} else
log_warn_suppress(_no_discard++, "WARNING: Thin pool target does "
"not support discard (needs kernel >= 3.4).");
- }
/*
* Add messages only for activation tree.
@@ -545,30 +542,24 @@ static int _thin_target_present(struct cmd_context *cmd,
log_error("Cannot read " THIN_MODULE " target version.");
return 0;
}
- log_debug("Target " THIN_MODULE " has version %d:%d:%d.",
- maj, min, patchlevel);
-
- /* For testing allow to override via shell variable */
- if (getenv("LVM_THIN_VERSION_MIN"))
- min = atoi(getenv("LVM_THIN_VERSION_MIN"));
if (maj >=1 && min >= 1)
_attrs |= THIN_FEATURE_DISCARD;
else
- log_verbose("Target " THIN_MODULE
- " without discard support.");
+ /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
+ log_debug("Target " THIN_MODULE " does not support discards.");
if (maj >=1 && min >= 1)
_attrs |= THIN_FEATURE_EXTERNAL_ORIGIN;
else
- log_verbose("Target " THIN_MODULE
- " without external origin support.");
+ /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
+ log_debug("Target " THIN_MODULE " does not support external origins.");
#if 0
if (maj >=1 && min >= 1)
_attrs |= THIN_FEATURE_BLOCK_SIZE;
else
- log_verbose("Target " THIN_MODULE
- " without non power of 2 block size.");
+ /* FIXME Log this as WARNING later only if the user asked for the feature to be used but it's not present */
+ log_debug("Target " THIN_MODULE " does not support non power of 2 block sizes.");
#endif
_checked = 1;
}
11 years, 8 months
master - man: expand lvchange --discard entry
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=597590da741248...
Commit: 597590da7412485ccdcb71ca909fbc5f73ec2aa1
Parent: 1ca813083f34082dd32ceab6e125ef379769e21e
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 20:20:16 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 20:20:16 2012 +0100
man: expand lvchange --discard entry
---
man/lvchange.8.in | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index beb77a8..e58d79c 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -73,7 +73,12 @@ 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.
+Set this to \fIignore\fP to ignore any discards received by a
+thin pool Logical Volume. Set to \fInopassdown\fP to process such
+discards within the thin pool itself and allow the no-longer-needed
+extents to be overwritten by new data. Set to \fIpassdown\fP to
+process them both within the thin pool itself and to pass them down
+the underlying device.
.TP
.B \-\-resync
Forces the complete resynchronization of a mirror. In normal
11 years, 8 months
master - thin: tidy commands.h arg lists
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1ca813083f3408...
Commit: 1ca813083f34082dd32ceab6e125ef379769e21e
Parent: b51241a346be6f31a525c1d547bed12ba2df34a3
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 20:10:06 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 20:10:06 2012 +0100
thin: tidy commands.h arg lists
args are listed alphabetically.
lvconvert -T is covered in the second section not the first.
It could be tidied further or split out.
---
tools/commands.h | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/tools/commands.h b/tools/commands.h
index 88c170a..47b540e 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -90,11 +90,11 @@ xx(lvchange,
"\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,
- discard_ARG, zero_ARG)
+ discard_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,
+ zero_ARG)
xx(lvconvert,
"Change logical volume layout",
@@ -180,10 +180,6 @@ 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 [--discard {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"
@@ -202,6 +198,7 @@ xx(lvcreate,
"\t[--alloc AllocationPolicy]\n"
"\t[-C|--contiguous {y|n}]\n"
"\t[-d|--debug]\n"
+ "\t[--discard {ignore|nopassdown|passdown}]\n"
"\t[-h|-?|--help]\n"
"\t[--ignoremonitoring]\n"
"\t[--monitor {y|n}]\n"
@@ -215,14 +212,14 @@ xx(lvcreate,
"\t[-p|--permission {r|rw}]\n"
"\t[-r|--readahead ReadAheadSectors|auto|none]\n"
"\t[-t|--test]\n"
- "\t[--thinpool] PoolLogicalVolume\n"
+ "\t[--thinpool ThinPoolLogicalVolume[Path]]\n"
"\t[-v|--verbose]\n"
"\t[--version]\n"
"\t[PhysicalVolumePath...]\n\n",
addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
- chunksize_ARG, contiguous_ARG, corelog_ARG, extents_ARG, discard_ARG,
+ chunksize_ARG, contiguous_ARG, corelog_ARG, discard_ARG, extents_ARG,
ignoremonitoring_ARG, major_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG,
monitor_ARG, name_ARG, nosync_ARG, noudevsync_ARG, permission_ARG,
persistent_ARG, readahead_ARG, regionsize_ARG, size_ARG, snapshot_ARG,
11 years, 8 months
master - thin: mention discard/zero in lvchange errmsg
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b51241a346be6f...
Commit: b51241a346be6f31a525c1d547bed12ba2df34a3
Parent: d01f8ee684992eaf4efc06453ee07cb2b9ebf49c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 20:08:14 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 20:08:14 2012 +0100
thin: mention discard/zero in lvchange errmsg
---
tools/lvchange.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index c5cbe08..1a4318f 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -98,7 +98,7 @@ static int lvchange_pool_update(struct cmd_context *cmd,
thin_discard_t discard;
if (!lv_is_thin_pool(lv)) {
- log_error("Logical volume \"%s\" is not a thinpool.", lv->name);
+ log_error("Logical volume \"%s\" is not a thin pool.", lv->name);
return 0;
}
@@ -839,15 +839,14 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG) ||
arg_count(cmd, addtag_ARG) || arg_count(cmd, deltag_ARG) ||
arg_count(cmd, resync_ARG) || arg_count(cmd, alloc_ARG) ||
- arg_count(cmd, discard_ARG) ||
- arg_count(cmd, zero_ARG);
+ arg_count(cmd, discard_ARG) || arg_count(cmd, zero_ARG);
if (!update &&
!arg_count(cmd, activate_ARG) && !arg_count(cmd, refresh_ARG) &&
!arg_count(cmd, monitor_ARG) && !arg_count(cmd, poll_ARG)) {
- log_error("Need 1 or more of -a, -C, -M, -p, -r, "
+ log_error("Need 1 or more of -a, -C, -M, -p, -r, -Z, "
"--resync, --refresh, --alloc, --addtag, --deltag, "
- "--monitor or --poll");
+ "--monitor, --poll or --discard");
return EINVALID_CMD_LINE;
}
11 years, 8 months
master - whitespace
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d01f8ee684992e...
Commit: d01f8ee684992eaf4efc06453ee07cb2b9ebf49c
Parent: e4fdfa9d314eeb02b6e4eb0e4bf053415b6b825e
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 19:04:52 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 19:04:52 2012 +0100
whitespace
---
libdm/libdm-config.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c
index 2423f9b..f8c0954 100644
--- a/libdm/libdm-config.c
+++ b/libdm/libdm-config.c
@@ -357,7 +357,6 @@ int dm_config_write_node(const struct dm_config_node *cn, dm_putline_fn putline,
return _write_node(cn, 0, putline, baton);
}
-
/*
* parser
*/
11 years, 8 months
master - report: provide discard field value in full
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e4fdfa9d314eeb...
Commit: e4fdfa9d314eeb02b6e4eb0e4bf053415b6b825e
Parent: 0650a16a2273f9ce8b224533083055b67cbff892
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Aug 7 18:48:34 2012 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Aug 7 18:48:34 2012 +0100
report: provide discard field value in full
I think it's better not to abbreviate human-readable fields like
'discard' to a single character. Users can truncate it to the
first character themselves if they wish.
It's confusing to use the variable name discard for different things in
different places - use discard_str when it's a string not the enum.
---
lib/report/columns.h | 2 +-
lib/report/report.c | 21 +++++----------------
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 7bcaaab..c869d14 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -140,7 +140,7 @@ FIELD(SEGS, seg, NUM, "Region", region_size, 6, size32, region_size, "For mirror
FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, chunksize, "For snapshots, the unit of data used when tracking changes.", 0)
FIELD(SEGS, seg, NUM, "Chunk", list, 5, chunksize, chunk_size, "For snapshots, the unit of data used when tracking changes.", 0)
FIELD(SEGS, seg, NUM, "#Thins", list, 4, thincount, thin_count, "For thin pools, the number of thin volumes in this pool.", 0)
-FIELD(SEGS, seg, NUM, "Dis", list, 3, discard, discard, "For thin pools, discard handling (i)ignore, (n)o_passdown, (p)assdown.", 0)
+FIELD(SEGS, seg, NUM, "Discard", list, 7, discard, discard, "For thin pools, how discards are handled.", 0)
FIELD(SEGS, seg, NUM, "Zero", list, 4, thinzero, zero, "For thin pools, if zeroing is enabled.", 0)
FIELD(SEGS, seg, NUM, "TransId", list, 4, transactionid, transaction_id, "For thin pools, the transaction id.", 0)
FIELD(SEGS, seg, NUM, "Start", list, 5, segstart, seg_start, "Offset within the LV to the start of the segment in current units.", 0)
diff --git a/lib/report/report.c b/lib/report/report.c
index 3121db3..b66be4f 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -568,29 +568,18 @@ static int _discard_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
{
- static const struct {
- const char c[2];
- unsigned val;
- thin_discard_t discard;
- } const arr[] = {
- { "p", 0, THIN_DISCARD_PASSDOWN },
- { "n", 1, THIN_DISCARD_NO_PASSDOWN },
- { "i", 2, THIN_DISCARD_IGNORE },
- { "" }
- };
const struct lv_segment *seg = (const struct lv_segment *) data;
- unsigned i = 0;
+ const char *discard_str;
if (seg_is_thin_volume(seg))
seg = first_seg(seg->pool_lv);
if (seg_is_thin_pool(seg)) {
- while (arr[i].c[0] && seg->discard != arr[i].discard)
- i++;
+ discard_str = get_pool_discard_name(seg->discard);
+ return dm_report_field_string(rh, field, &discard_str);
+ }
- dm_report_field_set_value(field, arr[i].c, &arr[i].val);
- } else
- dm_report_field_set_value(field, "", NULL);
+ dm_report_field_set_value(field, "", NULL);
return 1;
}
11 years, 8 months