Whamcloud - gitweb
LU-6210 mgs: Change positional struct initializers to C99 94/23794/2
authorSteve Guminski <stephenx.guminski@intel.com>
Wed, 16 Nov 2016 15:30:45 +0000 (10:30 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 1 Jan 2017 02:01:01 +0000 (02:01 +0000)
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 <stephenx.guminski@intel.com>
Change-Id: I36cbeaae50982b6f72d271997b229c46d085a6ee
Reviewed-on: https://review.whamcloud.com/23794
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mgs/mgs_handler.c
lustre/mgs/mgs_llog.c

index aec17ad..c9bcf21 100644 (file)
@@ -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;
index 16ebfd7..922f1e6 100644 (file)
@@ -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;