From 67a643f2c01da72b2918fa780a28d9c05fc3b15a Mon Sep 17 00:00:00 2001 From: Gu Zheng Date: Wed, 18 Sep 2019 12:12:55 +0800 Subject: [PATCH 1/1] LU-12705 utils: cleanup unnecessary typecasting There're a bunch of variables typeecasted in utils/lfs.c where they are not needed, so cleanup them here. Lustre-change: https://review.whamcloud.com/36224 Lustre-commit: d8135ad2fbe58a0fbe6984584816338542901c5c Change-Id: I6c944f18137fd1ff1162d9b6567c9328dfa185eb Test-Parameters: trivial Signed-off-by: Gu Zheng Reviewed-by: Andreas Dilger Reviewed-by: Li Xi Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/36313 Tested-by: jenkins Tested-by: Maloo --- lustre/utils/lfs.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 48719f6..251eedf 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -2241,13 +2241,13 @@ static int comp_args_to_layout(struct llapi_layout **composite, if (lsa->lsa_stripe_count != LLAPI_LAYOUT_DEFAULT) { fprintf(stderr, "Option 'stripe-count' can't be " "specified with Data-on-MDT component: %lld\n", - (long long)lsa->lsa_stripe_count); + lsa->lsa_stripe_count); return -EINVAL; } if (lsa->lsa_stripe_size != LLAPI_LAYOUT_DEFAULT) { fprintf(stderr, "Option 'stripe-size' can't be " "specified with Data-on-MDT component: %llu\n", - (unsigned long long)lsa->lsa_stripe_size); + lsa->lsa_stripe_size); return -EINVAL; } if (lsa->lsa_nr_tgts != 0) { @@ -2259,7 +2259,7 @@ static int comp_args_to_layout(struct llapi_layout **composite, if (lsa->lsa_stripe_off != LLAPI_LAYOUT_DEFAULT) { fprintf(stderr, "Option 'stripe-offset' can't be " "specified with Data-on-MDT component: %lld\n", - (long long)lsa->lsa_stripe_off); + lsa->lsa_stripe_off); return -EINVAL; } if (lsa->lsa_pool_name != 0) { @@ -2272,7 +2272,7 @@ static int comp_args_to_layout(struct llapi_layout **composite, rc = llapi_layout_pattern_set(layout, lsa->lsa_pattern); if (rc) { fprintf(stderr, "Set stripe pattern %#llx failed. %s\n", - (unsigned long long)lsa->lsa_pattern, + lsa->lsa_pattern, strerror(errno)); return rc; } @@ -2290,7 +2290,7 @@ static int comp_args_to_layout(struct llapi_layout **composite, rc = llapi_layout_stripe_count_set(layout, lsa->lsa_stripe_count); if (rc) { fprintf(stderr, "Set stripe count %lld failed: %s\n", - (long long)lsa->lsa_stripe_count, strerror(errno)); + lsa->lsa_stripe_count, strerror(errno)); return rc; } @@ -2323,7 +2323,7 @@ static int comp_args_to_layout(struct llapi_layout **composite, lsa->lsa_stripe_count != LLAPI_LAYOUT_WIDE && lsa->lsa_nr_tgts != lsa->lsa_stripe_count) { fprintf(stderr, "stripe_count(%lld) != nr_tgts(%d)\n", - (long long)lsa->lsa_stripe_count, + lsa->lsa_stripe_count, lsa->lsa_nr_tgts); return -EINVAL; } @@ -3350,8 +3350,7 @@ static int lfs_setstripe_internal(int argc, char **argv, lsa.lsa_stripe_count != lsa.lsa_nr_tgts) { fprintf(stderr, "error: %s: stripe count %lld doesn't match the number of MDTs: %d\n", - progname, - (long long)lsa.lsa_stripe_count, + progname, lsa.lsa_stripe_count, lsa.lsa_nr_tgts); free(lmu); goto usage_error; @@ -3400,8 +3399,7 @@ static int lfs_setstripe_internal(int argc, char **argv, lsa.lsa_nr_tgts != lsa.lsa_stripe_count) { fprintf(stderr, "error: %s: stripe count %lld doesn't match the number of OSTs: %d\n", - argv[0], - (long long)lsa.lsa_stripe_count, + argv[0], lsa.lsa_stripe_count, lsa.lsa_nr_tgts); free(param); goto usage_error; @@ -5246,7 +5244,7 @@ static int lfs_setdirstripe(int argc, char **argv) lsa.lsa_stripe_count != lsa.lsa_nr_tgts) { fprintf(stderr, "error: %s: stripe count %lld doesn't match the number of MDTs: %d\n", - argv[0], (long long)lsa.lsa_stripe_count, + argv[0], lsa.lsa_stripe_count, lsa.lsa_nr_tgts); free(param); return CMD_HELP; -- 1.8.3.1