master - cleanup: rename internal define
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=719d0996930dfad8608c49af2f81008b6ca77cb8 Commit: 719d0996930dfad8608c49af2f81008b6ca77cb8 Parent: 39703cb48514415633bc027e49e99e1ee7c4bbb4 Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Jun 2 11:18:04 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Jun 8 11:07:18 2017 +0200
cleanup: rename internal define
More descriptive name of #define.
--- lib/config/defaults.h | 2 +- lib/metadata/thin_manip.c | 2 +- liblvm/lvm_lv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
lib/config/defaults.h +1 -1
@@ -106,7 +106,7 @@#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024)/* KB */ #define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048/* KB */ -#define DEFAULT_THIN_POOL_OPTIMAL_SIZE (128 * 1024 * 1024)/* KB */ +#define DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE (128 * 1024 * 1024)/* KB */ #define DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY "generic"#define DEFAULT_THIN_POOL_CHUNK_SIZE 64/* KB */ #define DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE 512/* KB */
lib/metadata/thin_manip.c +1 -1
@@ -666,7 +666,7 @@ int update_thin_pool_params(struct cmd_context *cmd,/* Check if we should eventually use bigger chunk size */ while ((pool_metadata_size > - (DEFAULT_THIN_POOL_OPTIMAL_SIZE /SECTOR_SIZE )) && + (DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE /SECTOR_SIZE )) && (*chunk_size <DM_THIN_MAX_DATA_BLOCK_SIZE )) { *chunk_size <<=1 ; pool_metadata_size >>=1 ;
liblvm/lvm_lv.c +1 -1
@@ -507,7 +507,7 @@ static int _lv_set_pool_params(struct lvcreate_params *lp, pool_metadata_size = extents * vg->extent_size / (lp->chunk_size * (SECTOR_SIZE /64 ));while ((pool_metadata_size > - (2 *DEFAULT_THIN_POOL_OPTIMAL_SIZE /SECTOR_SIZE )) && + (2 *DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE /SECTOR_SIZE )) && lp->chunk_size <DM_THIN_MAX_DATA_BLOCK_SIZE ) { lp->chunk_size <<=1 ; pool_metadata_size >>=1 ;
Quoted 22 lines · Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=719d0996930dfad8608c49af2f81008b6ca77cb8 Commit: 719d0996930dfad8608c49af2f81008b6ca77cb8 Parent: 39703cb48514415633bc027e49e99e1ee7c4bbb4 Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Jun 2 11:18:04 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Jun 8 11:07:18 2017 +0200cleanup: rename internal define
More descriptive name of #define.
--- lib/config/defaults.h | 2 +- lib/metadata/thin_manip.c | 2 +- liblvm/lvm_lv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)lib/config/defaults.h +0
-0
lib/config/defaults.h line 109
Quoted 5 lines
lib/config/defaults.h +1
-1@@ -106,7 +106,7 @@#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024)/* KB */ #define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048/* KB */ -#define DEFAULT_THIN_POOL_OPTIMAL_SIZE (128 * 1024 * 1024)/* KB */ +#define DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE (128 * 1024 * 1024)/* KB */
Inconsistency here:
Should this be B instead of KB?
Or 128 * 1024 to make it consistent with the rest, and adjust calculations later?
-- Martian
Quoted 35 lines
lib/config/defaults.h +0
-0#define DEFAULT_THIN_POOL_CHUNK_SIZE_POLICY "generic"#define DEFAULT_THIN_POOL_CHUNK_SIZE 64/* KB */ #define DEFAULT_THIN_POOL_CHUNK_SIZE_PERFORMANCE 512/* KB */ lib/metadata/thin_manip.c +1
-1@@ -666,7 +666,7 @@ int update_thin_pool_params(struct cmd_context *cmd,/* Check if we should eventually use bigger chunk size */ while ((pool_metadata_size > - (DEFAULT_THIN_POOL_OPTIMAL_SIZE /SECTOR_SIZE )) && + (DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE /SECTOR_SIZE )) && (*chunk_size <DM_THIN_MAX_DATA_BLOCK_SIZE )) { *chunk_size <<=1 ; pool_metadata_size >>=1 ;liblvm/lvm_lv.c +1
-2@@ -507,7 +507,7 @@ static int _lv_set_pool_params(struct lvcreate_params *lp, pool_metadata_size = extents * vg->extent_size / (lp->chunk_size * (SECTOR_SIZE /64 ));while ((pool_metadata_size > - (2 *DEFAULT_THIN_POOL_OPTIMAL_SIZE /SECTOR_SIZE )) && + (2 *DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE /SECTOR_SIZE )) && lp->chunk_size <DM_THIN_MAX_DATA_BLOCK_SIZE ) { lp->chunk_size <<=1 ; pool_metadata_size >>=1 ; --lvm-devel mailing list
lvm-devel at redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel
Dne 9.6.2017 v 13:48 Marian Csontos napsal(a):
Quoted 33 lines · Zdenek Kabelac
Quoted 24 lines
Gitweb:
https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=719d0996930dfad8608c49af2f81008b6ca77cb8Commit: 719d0996930dfad8608c49af2f81008b6ca77cb8 Parent: 39703cb48514415633bc027e49e99e1ee7c4bbb4 Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Jun 2 11:18:04 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Jun 8 11:07:18 2017 +0200cleanup: rename internal define
More descriptive name of #define.
--- lib/config/defaults.h | 2 +- lib/metadata/thin_manip.c | 2 +- liblvm/lvm_lv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)lib/config/defaults.h +0
-0lib/config/defaults.h line 109
Quoted 5 lines
lib/config/defaults.h +1
-1@@ -106,7 +106,7 @@#define DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS 0#define DEFAULT_THIN_POOL_MAX_METADATA_SIZE (16 * 1024 * 1024)/* KB */ #define DEFAULT_THIN_POOL_MIN_METADATA_SIZE 2048/* KB */ -#define DEFAULT_THIN_POOL_OPTIMAL_SIZE (128 * 1024 * 1024)/* KB */ +#define DEFAULT_THIN_POOL_OPTIMAL_METADATA_SIZE (128 * 1024 * 1024)/* KB */ Inconsistency here:
Quoted 4 lines
Should this be B instead of KB?
Or 128 * 1024 to make it consistent with the rest, and adjust calculations later?
Hi
Thanks for noticing, you are possibly right - I should've also clean the numbers so we could drop sectorsize from calcs
I'll take a look.
Zdenek