From: Steve Guminski Date: Fri, 14 Apr 2017 19:45:59 +0000 (-0400) Subject: LU-6210 utils: Use C99 struct initializers in lfs_hsm_state() X-Git-Tag: 2.10.51~67 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=refs%2Fchanges%2F25%2F27525%2F2;ds=sidebyside LU-6210 utils: Use C99 struct initializers in lfs_hsm_state() This patch makes no functional changes. Struct initializers that use C89 or GCC-only syntax are updated to C99 syntax. C89 positional initializers require values to be placed in the correct order. This will cause errors if the fields of the struct definition are reordered or fields are added or removed. C99 named initializers avoid this problem, and also automatically clear any values that are not explicitly set. This patch updates lfs_hsm_state() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I32f427396e99f1b86d329eb8457883a9aaaed181 Reviewed-on: https://review.whamcloud.com/27525 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 6aeb484..f0e8543 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -4774,14 +4774,13 @@ static int lfs_hsm_state(int argc, char **argv) static int lfs_hsm_change_flags(int argc, char **argv, int mode) { struct option long_opts[] = { - {"lost", 0, 0, 'l'}, - {"norelease", 0, 0, 'r'}, - {"noarchive", 0, 0, 'a'}, - {"archived", 0, 0, 'A'}, - {"dirty", 0, 0, 'd'}, - {"exists", 0, 0, 'e'}, - {0, 0, 0, 0} - }; + { .val = 'A', .name = "archived", .has_arg = no_argument }, + { .val = 'a', .name = "noarchive", .has_arg = no_argument }, + { .val = 'd', .name = "dirty", .has_arg = no_argument }, + { .val = 'e', .name = "exists", .has_arg = no_argument }, + { .val = 'l', .name = "lost", .has_arg = no_argument }, + { .val = 'r', .name = "norelease", .has_arg = no_argument }, + { .name = NULL } }; char short_opts[] = "lraAde"; __u64 mask = 0; int c, rc;