From 5419eabdfedd80d3f30aa456ad7dd35c3198729b Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Wed, 16 Nov 2016 10:30:45 -0500 Subject: [PATCH] LU-6210 mgs: Change positional struct initializers to C99 This patch makes no functional changes. Struct initializers in the mgs directory that use C89 or GCC-only syntax are updated to C99 syntax. Whitespace is corrected to match the coding style guidelines. 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/mgs/mgs_handler.c: struct lustre_handle lockh struct lustre_handle conn lustre/mgs/mgs_llog.c: struct mgs_fsdb_handler_data d Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I36cbeaae50982b6f72d271997b229c46d085a6ee Reviewed-on: https://review.whamcloud.com/23794 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Nathaniel Clark Reviewed-by: Oleg Drokin --- lustre/mgs/mgs_handler.c | 8 ++++++-- lustre/mgs/mgs_llog.c | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index aec17ad..c9bcf21 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -225,7 +225,9 @@ static int mgs_completion_ast_ir(struct ldlm_lock *lock, __u64 flags, void mgs_revoke_lock(struct mgs_device *mgs, struct fs_db *fsdb, int type) { ldlm_completion_callback cp = NULL; - struct lustre_handle lockh = { 0 }; + struct lustre_handle lockh = { + .cookie = 0, + }; struct ldlm_res_id res_id; __u64 flags = LDLM_FL_ATOMIC_CB; int rc; @@ -1480,7 +1482,9 @@ static int mgs_obd_connect(const struct lu_env *env, struct obd_export **exp, struct obd_connect_data *data, void *localdata) { struct obd_export *lexp; - struct lustre_handle conn = { 0 }; + struct lustre_handle conn = { + .cookie = 0, + }; int rc; ENTRY; diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 16ebfd7..922f1e6 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -261,10 +261,12 @@ static int mgs_get_fsdb_from_llog(const struct lu_env *env, struct mgs_device *mgs, struct fs_db *fsdb) { - char *logname; - struct llog_handle *loghandle; - struct llog_ctxt *ctxt; - struct mgs_fsdb_handler_data d = { fsdb, 0 }; + char *logname; + struct llog_handle *loghandle; + struct llog_ctxt *ctxt; + struct mgs_fsdb_handler_data d = { + .fsdb = fsdb, + }; int rc; ENTRY; -- 1.8.3.1