Whamcloud - gitweb
LU-6210 utils: Use C99 struct initializer in mount_utils_zfs.c 25/27825/2
authorSteve Guminski <stephenx.guminski@intel.com>
Mon, 26 Jun 2017 17:53:13 +0000 (13:53 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 1 Aug 2017 05:34:42 +0000 (05:34 +0000)
This patch makes no functional changes.  The ZLB_INIT macro is
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.

Test-Parameters: trivial
Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: Ieaf53059782254935a13f0efd3f72785dacc0b8b
Reviewed-on: https://review.whamcloud.com/27825
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
lustre/utils/mount_utils_zfs.c

index aacf076..ea495e3 100644 (file)
@@ -77,10 +77,12 @@ static int zfs_set_prop_str(zfs_handle_t *, char *, void *);
  *              the @name property. (e.g. ldd_fsname, ldd_config_ver, etc.)
  *    - @type: The type of @field. Only "int" and "str" are supported.
  */
-#define ZLB_INIT(name, field, type)                    \
-{                                                      \
-       name, offsetof(struct lustre_disk_data, field), \
-       zfs_get_prop_ ## type, zfs_set_prop_ ## type    \
+#define ZLB_INIT(name, field, type)                                    \
+{                                                                      \
+       .zlpb_prop_name   = name,                                       \
+       .zlpb_ldd_offset  = offsetof(struct lustre_disk_data, field),   \
+       .zlpb_get_prop_fn = zfs_get_prop_ ## type,                      \
+       .zlpb_set_prop_fn = zfs_set_prop_ ## type                       \
 }
 
 /* These ldd properties are special because they all have their own