diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-01-05 15:38:18 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-01-05 15:38:18 +0000 |
commit | 4fbde0143a553a7135558cc8e8bc0503beacdb78 (patch) | |
tree | 535afe3dc1d4a2ccdd7a58df69fcb20b03deea3a /tools/tools.h | |
parent | 1aae627433e7ec2a4acbcffa04be4bf4f89dba65 (diff) | |
download | lvm2-4fbde0143a553a7135558cc8e8bc0503beacdb78.tar.gz lvm2-4fbde0143a553a7135558cc8e8bc0503beacdb78.tar.xz lvm2-4fbde0143a553a7135558cc8e8bc0503beacdb78.zip |
Support rounding of percentage upward
We want to keep this logic -
when LV is extend - extend the LV by at least given amount,
when LV is reduced - reduce the LV by at most given amount.
So for this the rounding needs to be used.
Current logic which seems to satisfy give rule is to round up all
extent values for LV resize upward except for values with '-' sign
that are round downward.
This patch also fixes the problem when lvextend --use-polices tried
to extend LV the by i.e. 20% - but the resulting 20% were smaller
the extent size thus before this patch no extension happened.
Diffstat (limited to 'tools/tools.h')
-rw-r--r-- | tools/tools.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/tools.h b/tools/tools.h index f1ae1732..50a0fc9e 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -181,5 +181,5 @@ int lvconvert_poll(struct cmd_context *cmd, struct logical_volume *lv, unsigned int mirror_remove_missing(struct cmd_context *cmd, struct logical_volume *lv, int force); -uint32_t percent_of_extents(uint32_t percents, uint32_t count); +uint32_t percent_of_extents(uint32_t percents, uint32_t count, int roundup); #endif |