From: Steve Guminski Date: Fri, 14 Apr 2017 19:23:03 +0000 (-0400) Subject: LU-6210 utils: Use C99 struct initializers in mntdf() X-Git-Tag: 2.10.51~69 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0ff91d6ad8c71498e29f442119327e166f527281 LU-6210 utils: Use C99 struct initializers in mntdf() 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 mntdf() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: Ic4e446ecb03695b2526b0890f7bfeb76b1bfee88 Reviewed-on: https://review.whamcloud.com/27517 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 7531605..cd70601 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -3258,9 +3258,10 @@ static int mntdf(char *mntdir, char *fsname, char *pool, enum mntdf_flags flags) struct obd_statfs stat_buf, sum = { .os_bsize = 1 }; struct obd_uuid uuid_buf; char *poolname = NULL; - struct ll_stat_type types[] = { { LL_STATFS_LMV, "MDT" }, - { LL_STATFS_LOV, "OST" }, - { 0, NULL } }; + struct ll_stat_type types[] = { + { .st_op = LL_STATFS_LMV, .st_name = "MDT" }, + { .st_op = LL_STATFS_LOV, .st_name = "OST" }, + { .st_name = NULL } }; struct ll_stat_type *tp; __u64 ost_ffree = 0; __u32 index;