Whamcloud - gitweb
LU-6210 mdt: Change positional struct initializers to C99 02/23702/2
authorSteve Guminski <stephenx.guminski@intel.com>
Thu, 10 Nov 2016 18:21:23 +0000 (13:21 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 1 Jan 2017 02:00:45 +0000 (02:00 +0000)
This patch makes no functional changes.  Struct initializers in the
mdt 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/mdt/mdt_lvb.c:
struct ldlm_valblock_ops mdt_lvbo
lustre/mdt/mdt_mds.c:
static struct lprocfs_vars lprocfs_mds_obd_vars[]

Test-Parameters: trivial
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: If8b3b6233e34f6e8406ab6b8e4e70845bf94bfc8
Reviewed-on: https://review.whamcloud.com/23702
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_lvb.c
lustre/mdt/mdt_mds.c

index 24b0f9a..d4c5097 100644 (file)
@@ -197,9 +197,9 @@ static int mdt_lvbo_free(struct ldlm_resource *res)
 }
 
 struct ldlm_valblock_ops mdt_lvbo = {
-       lvbo_init:      mdt_lvbo_init,
-       lvbo_update:    mdt_lvbo_update,
-       lvbo_size:      mdt_lvbo_size,
-       lvbo_fill:      mdt_lvbo_fill,
-       lvbo_free:      mdt_lvbo_free
+       .lvbo_init      = mdt_lvbo_init,
+       .lvbo_update    = mdt_lvbo_update,
+       .lvbo_size      = mdt_lvbo_size,
+       .lvbo_fill      = mdt_lvbo_fill,
+       .lvbo_free      = mdt_lvbo_free
 };
index 1e84321..6201431 100644 (file)
@@ -471,8 +471,13 @@ static struct lu_device *mds_device_free(const struct lu_env *env,
 LPROC_SEQ_FOPS_RO_TYPE(mds, uuid);
 
 static struct lprocfs_vars lprocfs_mds_obd_vars[] = {
-       { "uuid",       &mds_uuid_fops  },
-       { NULL }
+       {
+               .name   = "uuid",
+               .fops   = &mds_uuid_fops
+       },
+       {
+               .name   = NULL
+       }
 };
 
 static struct lu_device *mds_device_alloc(const struct lu_env *env,