From c7785d49520bdf101cd0b1ea03ee236f66054eb5 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Wed, 15 Mar 2017 22:28:27 -0400 Subject: [PATCH] LU-9216 config: move config types into lustre_idl.h Move config type values CONFIG_T_XXX into lustre_idl.h since they will be put on wire when reading config log for IR and nodemap. Add missing wire checks for mgs_nidtbl_entry, mgs_config_body and mgs_config_res. Redefine CONFIG_SUB_XXX for the sub clds attached on config log. Test-Parameters: clientjob=lustre-b2_7_fe clientbuildno=133 testlist=runtests Signed-off-by: Niu Yawei Change-Id: I9eb7a89c0fee0c11666bc8f587d3fd5e2ad4fc8d Reviewed-on: https://review.whamcloud.com/26022 Tested-by: Jenkins Reviewed-by: Fan Yong Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustre_idl.h | 10 +++++ lustre/include/obd_class.h | 18 ++++---- lustre/mgc/mgc_request.c | 10 ++--- lustre/ptlrpc/wiretest.c | 86 ++++++++++++++++++++++++++++++++++++++ lustre/utils/wirecheck.c | 48 +++++++++++++++++++++ lustre/utils/wiretest.c | 86 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 244 insertions(+), 14 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index ab14d6d..9049685 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -2335,6 +2335,16 @@ struct mgs_nidtbl_entry { } u; }; +enum { + CONFIG_T_CONFIG = 0, + CONFIG_T_SPTLRPC = 1, + CONFIG_T_RECOVER = 2, + CONFIG_T_PARAMS = 3, + CONFIG_T_NODEMAP = 4, + CONFIG_T_BARRIER = 5, + CONFIG_T_MAX +}; + struct mgs_config_body { char mcb_name[MTI_NAME_MAXLEN]; /* logname */ __u64 mcb_offset; /* next index of config log to request */ diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 2dd520a..b3fcd07 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -162,18 +162,18 @@ struct config_llog_instance { int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt, char *name, struct config_llog_instance *cfg); -#define CONFIG_T_CONFIG 0x01 -#define CONFIG_T_SPTLRPC 0x02 -#define CONFIG_T_RECOVER 0x04 -#define CONFIG_T_PARAMS 0x08 -#define CONFIG_T_NODEMAP 0x10 -#define CONFIG_T_BARRIER 0x20 +#define CONFIG_SUB_SPTLRPC 0x01 +#define CONFIG_SUB_RECOVER 0x02 +#define CONFIG_SUB_PARAMS 0x04 +#define CONFIG_SUB_NODEMAP 0x08 +#define CONFIG_SUB_BARRIER 0x10 /* Sub clds should be attached to the config_llog_data when processing * config log for client or server target. */ -#define CONFIG_SUB_CLIENT (CONFIG_T_SPTLRPC | CONFIG_T_RECOVER | \ - CONFIG_T_PARAMS) -#define CONFIG_SUB_SERVER (CONFIG_SUB_CLIENT | CONFIG_T_NODEMAP) +#define CONFIG_SUB_CLIENT (CONFIG_SUB_SPTLRPC | CONFIG_SUB_RECOVER | \ + CONFIG_SUB_PARAMS) +#define CONFIG_SUB_SERVER (CONFIG_SUB_CLIENT | CONFIG_SUB_NODEMAP | \ + CONFIG_SUB_BARRIER) #define PARAMS_FILENAME "params" #define BARRIER_FILENAME "barrier" diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 119c0df..7b19c21 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -344,7 +344,7 @@ config_log_add(struct obd_device *obd, char *logname, memcpy(seclogname, logname, ptr - logname); strcpy(seclogname + (ptr - logname), "-sptlrpc"); - if (cfg->cfg_sub_clds & CONFIG_T_SPTLRPC) { + if (cfg->cfg_sub_clds & CONFIG_SUB_SPTLRPC) { sptlrpc_cld = config_log_find_or_add(obd, seclogname, NULL, CONFIG_T_SPTLRPC, cfg); if (IS_ERR(sptlrpc_cld)) { @@ -354,7 +354,7 @@ config_log_add(struct obd_device *obd, char *logname, } } - if (!IS_MGS(lsi) && cfg->cfg_sub_clds & CONFIG_T_NODEMAP) { + if (!IS_MGS(lsi) && cfg->cfg_sub_clds & CONFIG_SUB_NODEMAP) { nodemap_cld = config_log_find_or_add(obd, LUSTRE_NODEMAP_NAME, NULL, CONFIG_T_NODEMAP, cfg); @@ -366,7 +366,7 @@ config_log_add(struct obd_device *obd, char *logname, } } - if (cfg->cfg_sub_clds & CONFIG_T_PARAMS) { + if (cfg->cfg_sub_clds & CONFIG_SUB_PARAMS) { params_cld = config_log_find_or_add(obd, PARAMS_FILENAME, sb, CONFIG_T_PARAMS, cfg); if (IS_ERR(params_cld)) { @@ -377,7 +377,7 @@ config_log_add(struct obd_device *obd, char *logname, } } - if (IS_MDT(s2lsi(sb))) { + if (IS_MDT(s2lsi(sb)) && cfg->cfg_sub_clds & CONFIG_SUB_BARRIER) { snprintf(seclogname + (ptr - logname), sizeof(seclogname) - 1, "-%s", BARRIER_FILENAME); barrier_cld = config_log_find_or_add(obd, seclogname, sb, @@ -400,7 +400,7 @@ config_log_add(struct obd_device *obd, char *logname, LASSERT(lsi->lsi_lmd); if (!(lsi->lsi_lmd->lmd_flags & LMD_FLG_NOIR) && - cfg->cfg_sub_clds & CONFIG_T_RECOVER) { + cfg->cfg_sub_clds & CONFIG_SUB_RECOVER) { struct config_llog_data *recover_cld; ptr = strrchr(seclogname, '-'); diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 41d2b58..a950e33 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -3971,6 +3971,92 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_params) == 4096, "found %lld\n", (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_params)); + /* Checks for struct mgs_nidtbl_entry */ + LASSERTF((int)sizeof(struct mgs_nidtbl_entry) == 24, "found %lld\n", + (long long)(int)sizeof(struct mgs_nidtbl_entry)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_version) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_version)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_version) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_version)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_instance) == 8, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_instance)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_instance) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_instance)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_index) == 12, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_index)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_index)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_length) == 16, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_length)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_length) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_length)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_type) == 20, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_type)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_type) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_type)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_nid_type) == 21, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_nid_type)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_type) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_type)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_nid_size) == 22, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_nid_size)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_size) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_size)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_nid_count) == 23, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_nid_count)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_count) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_count)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, u.nids[0]) == 24, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, u.nids[0])); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->u.nids[0]) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->u.nids[0])); + + /* Checks for struct mgs_config_body */ + LASSERTF((int)sizeof(struct mgs_config_body) == 80, "found %lld\n", + (long long)(int)sizeof(struct mgs_config_body)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_name) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_name)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_name) == 64, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_name)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_offset) == 64, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_offset)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_offset)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_type) == 72, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_type)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_type) == 2, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_type)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_nm_cur_pass) == 74, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_nm_cur_pass)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_nm_cur_pass) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_nm_cur_pass)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_bits) == 75, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_bits)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_bits) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_bits)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_units) == 76, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_units)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_units) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_units)); + CLASSERT(CONFIG_T_CONFIG == 0); + CLASSERT(CONFIG_T_SPTLRPC == 1); + CLASSERT(CONFIG_T_RECOVER == 2); + CLASSERT(CONFIG_T_PARAMS == 3); + CLASSERT(CONFIG_T_NODEMAP == 4); + CLASSERT(CONFIG_T_BARRIER == 5); + + /* Checks for struct mgs_config_res */ + LASSERTF((int)sizeof(struct mgs_config_res) == 16, "found %lld\n", + (long long)(int)sizeof(struct mgs_config_res)); + LASSERTF((int)offsetof(struct mgs_config_res, mcr_offset) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_res, mcr_offset)); + LASSERTF((int)sizeof(((struct mgs_config_res *)0)->mcr_offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_res *)0)->mcr_offset)); + LASSERTF((int)offsetof(struct mgs_config_res, mcr_size) == 8, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_res, mcr_size)); + LASSERTF((int)sizeof(((struct mgs_config_res *)0)->mcr_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_res *)0)->mcr_size)); + /* Checks for struct lustre_capa */ LASSERTF((int)sizeof(struct lustre_capa) == 120, "found %lld\n", (long long)(int)sizeof(struct lustre_capa)); diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index fb2d3ee..04f75ee 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -1813,6 +1813,51 @@ check_mgs_target_info(void) } static void +check_mgs_nidtbl_entry(void) +{ + BLANK_LINE(); + CHECK_STRUCT(mgs_nidtbl_entry); + CHECK_MEMBER(mgs_nidtbl_entry, mne_version); + CHECK_MEMBER(mgs_nidtbl_entry, mne_instance); + CHECK_MEMBER(mgs_nidtbl_entry, mne_index); + CHECK_MEMBER(mgs_nidtbl_entry, mne_length); + CHECK_MEMBER(mgs_nidtbl_entry, mne_type); + CHECK_MEMBER(mgs_nidtbl_entry, mne_nid_type); + CHECK_MEMBER(mgs_nidtbl_entry, mne_nid_size); + CHECK_MEMBER(mgs_nidtbl_entry, mne_nid_count); + CHECK_MEMBER(mgs_nidtbl_entry, u.nids[0]); +} + +static void +check_mgs_config_body(void) +{ + BLANK_LINE(); + CHECK_STRUCT(mgs_config_body); + CHECK_MEMBER(mgs_config_body, mcb_name); + CHECK_MEMBER(mgs_config_body, mcb_offset); + CHECK_MEMBER(mgs_config_body, mcb_type); + CHECK_MEMBER(mgs_config_body, mcb_nm_cur_pass); + CHECK_MEMBER(mgs_config_body, mcb_bits); + CHECK_MEMBER(mgs_config_body, mcb_units); + + CHECK_CVALUE(CONFIG_T_CONFIG); + CHECK_CVALUE(CONFIG_T_SPTLRPC); + CHECK_CVALUE(CONFIG_T_RECOVER); + CHECK_CVALUE(CONFIG_T_PARAMS); + CHECK_CVALUE(CONFIG_T_NODEMAP); + CHECK_CVALUE(CONFIG_T_BARRIER); +} + +static void +check_mgs_config_res(void) +{ + BLANK_LINE(); + CHECK_STRUCT(mgs_config_res); + CHECK_MEMBER(mgs_config_res, mcr_offset); + CHECK_MEMBER(mgs_config_res, mcr_size); +} + +static void check_lustre_capa(void) { BLANK_LINE(); @@ -2716,6 +2761,9 @@ main(int argc, char **argv) check_ll_fiemap_info_key(); check_quota_body(); check_mgs_target_info(); + check_mgs_nidtbl_entry(); + check_mgs_config_body(); + check_mgs_config_res(); check_lustre_capa(); check_lustre_capa_key(); check_getinfo_fid2path(); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index dbd03d9..487af70 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -3991,6 +3991,92 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct mgs_target_info *)0)->mti_params) == 4096, "found %lld\n", (long long)(int)sizeof(((struct mgs_target_info *)0)->mti_params)); + /* Checks for struct mgs_nidtbl_entry */ + LASSERTF((int)sizeof(struct mgs_nidtbl_entry) == 24, "found %lld\n", + (long long)(int)sizeof(struct mgs_nidtbl_entry)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_version) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_version)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_version) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_version)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_instance) == 8, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_instance)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_instance) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_instance)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_index) == 12, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_index)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_index) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_index)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_length) == 16, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_length)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_length) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_length)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_type) == 20, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_type)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_type) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_type)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_nid_type) == 21, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_nid_type)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_type) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_type)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_nid_size) == 22, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_nid_size)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_size) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_size)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, mne_nid_count) == 23, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, mne_nid_count)); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_count) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->mne_nid_count)); + LASSERTF((int)offsetof(struct mgs_nidtbl_entry, u.nids[0]) == 24, "found %lld\n", + (long long)(int)offsetof(struct mgs_nidtbl_entry, u.nids[0])); + LASSERTF((int)sizeof(((struct mgs_nidtbl_entry *)0)->u.nids[0]) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_nidtbl_entry *)0)->u.nids[0])); + + /* Checks for struct mgs_config_body */ + LASSERTF((int)sizeof(struct mgs_config_body) == 80, "found %lld\n", + (long long)(int)sizeof(struct mgs_config_body)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_name) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_name)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_name) == 64, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_name)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_offset) == 64, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_offset)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_offset)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_type) == 72, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_type)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_type) == 2, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_type)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_nm_cur_pass) == 74, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_nm_cur_pass)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_nm_cur_pass) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_nm_cur_pass)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_bits) == 75, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_bits)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_bits) == 1, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_bits)); + LASSERTF((int)offsetof(struct mgs_config_body, mcb_units) == 76, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_body, mcb_units)); + LASSERTF((int)sizeof(((struct mgs_config_body *)0)->mcb_units) == 4, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_body *)0)->mcb_units)); + CLASSERT(CONFIG_T_CONFIG == 0); + CLASSERT(CONFIG_T_SPTLRPC == 1); + CLASSERT(CONFIG_T_RECOVER == 2); + CLASSERT(CONFIG_T_PARAMS == 3); + CLASSERT(CONFIG_T_NODEMAP == 4); + CLASSERT(CONFIG_T_BARRIER == 5); + + /* Checks for struct mgs_config_res */ + LASSERTF((int)sizeof(struct mgs_config_res) == 16, "found %lld\n", + (long long)(int)sizeof(struct mgs_config_res)); + LASSERTF((int)offsetof(struct mgs_config_res, mcr_offset) == 0, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_res, mcr_offset)); + LASSERTF((int)sizeof(((struct mgs_config_res *)0)->mcr_offset) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_res *)0)->mcr_offset)); + LASSERTF((int)offsetof(struct mgs_config_res, mcr_size) == 8, "found %lld\n", + (long long)(int)offsetof(struct mgs_config_res, mcr_size)); + LASSERTF((int)sizeof(((struct mgs_config_res *)0)->mcr_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct mgs_config_res *)0)->mcr_size)); + /* Checks for struct lustre_capa */ LASSERTF((int)sizeof(struct lustre_capa) == 120, "found %lld\n", (long long)(int)sizeof(struct lustre_capa)); -- 1.8.3.1