From 990890eacf757d73fc87a83bfa703a51b739a05c Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Mon, 26 Jun 2017 13:53:13 -0400 Subject: [PATCH] LU-6210 utils: Use C99 struct initializer in mount_utils_zfs.c 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 Change-Id: Ieaf53059782254935a13f0efd3f72785dacc0b8b Reviewed-on: https://review.whamcloud.com/27825 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons --- lustre/utils/mount_utils_zfs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/utils/mount_utils_zfs.c b/lustre/utils/mount_utils_zfs.c index aacf076..ea495e3 100644 --- a/lustre/utils/mount_utils_zfs.c +++ b/lustre/utils/mount_utils_zfs.c @@ -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 -- 1.8.3.1