From cc311c0c9f884234a3458f471640a40d24c011b5 Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Wed, 16 Nov 2016 09:24:34 -0500 Subject: [PATCH] LU-6210 fid: Change positional struct initializers to C99 This patch makes no functional changes. Struct initializers in the fid directory that use C89 or GCC-only syntax are updated to C99 syntax. The C99 syntax prevents incorrect initialization if values are accidently placed in the wrong position, allows changes in the struct definition, and clears any members that are not given an explicit value. The following struct initializers have been updated: lustre/fid/fid_lib.c: const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE const struct lu_seq_range LUSTRE_SEQ_ZERO_RANGE lustre/fid/lproc_fid.c: struct lu_seq_range tmp Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I73b6a37a0fcac29ba48410e7befb98f13bdb17cc Reviewed-on: https://review.whamcloud.com/23789 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/fid/fid_lib.c | 7 +++---- lustre/fid/lproc_fid.c | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/fid/fid_lib.c b/lustre/fid/fid_lib.c index d3cd115..7c5477c 100644 --- a/lustre/fid/fid_lib.c +++ b/lustre/fid/fid_lib.c @@ -60,14 +60,13 @@ * FID_SEQ_START + 2 is for .lustre directory and its objects */ const struct lu_seq_range LUSTRE_SEQ_SPACE_RANGE = { - FID_SEQ_NORMAL, - (__u64)~0ULL + .lsr_start = FID_SEQ_NORMAL, + .lsr_end = (__u64)~0ULL, }; /* Zero range, used for init and other purposes. */ const struct lu_seq_range LUSTRE_SEQ_ZERO_RANGE = { - 0, - 0 + .lsr_start = 0, }; /* Lustre Big Fs Lock fid. */ diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index 3fc2481..11ae1b6 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -63,7 +63,9 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count, struct lu_seq_range *range) { - struct lu_seq_range tmp = { 0, }; + struct lu_seq_range tmp = { + .lsr_start = 0, + }; char kernbuf[MAX_FID_RANGE_STRLEN]; ENTRY; -- 1.8.3.1