From 5a8f63b80f705756e0d530706c20793924a975a1 Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 14 Apr 2017 15:31:40 -0400 Subject: [PATCH] LU-6210 utils: Use C99 struct initializers in lfs_setquota() 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_setquota() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I4bae3ccf40380d662b151b8ac53976f38c63daf6 Reviewed-on: https://review.whamcloud.com/27521 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- lustre/utils/lfs.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 1c77560..ef2205a 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -3709,15 +3709,18 @@ int lfs_setquota(int argc, char **argv) char *mnt, *obd_type = (char *)qctl.obd_type; struct obd_dqblk *dqb = &qctl.qc_dqblk; struct option long_opts[] = { - {"block-softlimit", required_argument, 0, 'b'}, - {"block-hardlimit", required_argument, 0, 'B'}, - {"group", required_argument, 0, 'g'}, - {"inode-softlimit", required_argument, 0, 'i'}, - {"inode-hardlimit", required_argument, 0, 'I'}, - {"user", required_argument, 0, 'u'}, - {"projid", required_argument, 0, 'p'}, - {0, 0, 0, 0} - }; + { .val = 'b', .name = "block-softlimit", + .has_arg = required_argument }, + { .val = 'B', .name = "block-hardlimit", + .has_arg = required_argument }, + { .val = 'g', .name = "group", .has_arg = required_argument }, + { .val = 'i', .name = "inode-softlimit", + .has_arg = required_argument }, + { .val = 'I', .name = "inode-hardlimit", + .has_arg = required_argument }, + { .val = 'p', .name = "projid", .has_arg = required_argument }, + { .val = 'u', .name = "user", .has_arg = required_argument }, + { .name = NULL } }; unsigned limit_mask = 0; char *endptr; int qtype; -- 1.8.3.1