(long long)(int)offsetof(struct lustre_som_attrs, lsa_blocks));
LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_blocks) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_blocks));
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct lustre_mdt_attrs */
Q_GETOQUOTA);
LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n",
Q_FINVALIDATE);
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct lquota_acct_rec */
(long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_pad2));
LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad2) == 8, "found %lld\n",
(long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad2));
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct ldlm_gl_barrier_desc */
LASSERTF((int)sizeof(((struct hsm_user_import *)0)->hui_archive_id) == 4, "found %lld\n",
(long long)(int)sizeof(((struct hsm_user_import *)0)->hui_archive_id));
+#ifndef HAVE_NATIVE_LINUX_CLIENT
+
/* Checks for struct netobj_s */
LASSERTF((int)sizeof(struct netobj_s) == 4, "found %lld\n",
(long long)(int)sizeof(struct netobj_s));
(long long)(int)offsetof(struct gss_wire_ctx, gw_handle));
LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_handle) == 16, "found %lld\n",
(long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_handle));
+#endif /* HAVE_NATIVE_LINUX_CLIENT */
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct object_update_param */
(long long)(int)offsetof(struct nodemap_cluster_rec, ncr_name[16 + 1]));
LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_name[16 + 1]) == 1, "found %lld\n",
(long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_name[16 + 1]));
+ /* nodemap_cluster_rec.ncr_flags is a bitfield and cannot be checked */
+ /* nodemap_cluster_rec.ncr_flags2 is a bitfield and cannot be checked */
LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_padding1) == 19, "found %lld\n",
(long long)(int)offsetof(struct nodemap_cluster_rec, ncr_padding1));
LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding1) == 1, "found %lld\n",
(int)sizeof(((struct s2 *)0)->m)); \
} while (0)
+/* could maybe check this in the future, just add a comment for now */
+#define CHECK_BITFIELD(s, m) \
+ COMMENT(""#s"."#m" is a bitfield and cannot be checked")
+
+#define CHECK_COND_START(cond) printf("\n#ifdef "#cond"\n")
+#define CHECK_COND_STARTN(cond) printf("\n#ifndef "#cond"\n")
+#define CHECK_COND_FINISH(cond) printf("#endif /* "#cond" */\n")
+
static void
check_lu_seq_range(void)
{
CHECK_STRUCT(nodemap_cluster_rec);
CHECK_CDEFINE(LUSTRE_NODEMAP_NAME_LENGTH);
CHECK_MEMBER(nodemap_cluster_rec, ncr_name[LUSTRE_NODEMAP_NAME_LENGTH + 1]);
-#if 0 /* cannot check offset of 8-bit bitfield */
- CHECK_MEMBER(nodemap_cluster_rec, ncr_flags);
- CHECK_MEMBER(nodemap_cluster_rec, ncr_flags2);
-#endif
+ CHECK_BITFIELD(nodemap_cluster_rec, ncr_flags);
+ CHECK_BITFIELD(nodemap_cluster_rec, ncr_flags2);
CHECK_MEMBER(nodemap_cluster_rec, ncr_padding1);
CHECK_MEMBER(nodemap_cluster_rec, ncr_squash_projid);
CHECK_MEMBER(nodemap_cluster_rec, ncr_squash_uid);
check_lu_seq_range();
check_som_attrs();
#ifndef HAVE_NATIVE_LINUX_CLIENT
- printf("#ifdef HAVE_SERVER_SUPPORT\n");
+ CHECK_COND_START(HAVE_SERVER_SUPPORT);
check_lustre_mdt_attrs();
check_lustre_ost_attrs();
CHECK_VALUE(OUT_XATTR_LIST);
check_hsm_attrs();
- printf("#endif /* HAVE_SERVER_SUPPORT */\n");
+ CHECK_COND_FINISH(HAVE_SERVER_SUPPORT);
#endif /* !HAVE_NATIVE_LINUX_CLIENT */
check_ost_id();
check_lu_dirent();
check_obd_ioobj();
check_obd_quotactl();
#ifndef HAVE_NATIVE_LINUX_CLIENT
- printf("#ifdef HAVE_SERVER_SUPPORT\n");
+ CHECK_COND_START(HAVE_SERVER_SUPPORT);
check_obd_quotactl_server();
check_obd_idx_read();
- printf("#endif /* HAVE_SERVER_SUPPORT */\n");
+ CHECK_COND_FINISH(HAVE_SERVER_SUPPORT);
#endif /* !HAVE_NATIVE_LINUX_CLIENT */
check_niobuf_remote();
check_ost_body();
check_ldlm_lquota_lvb();
check_ldlm_gl_lquota_desc();
#ifndef HAVE_NATIVE_LINUX_CLIENT
- printf("#ifdef HAVE_SERVER_SUPPORT\n");
+ CHECK_COND_START(HAVE_SERVER_SUPPORT);
check_ldlm_gl_barrier_desc();
check_ldlm_barrier_lvb();
-printf("#endif /* HAVE_SERVER_SUPPORT */\n");
+ CHECK_COND_FINISH(HAVE_SERVER_SUPPORT);
#endif /* !HAVE_NATIVE_LINUX_CLIENT */
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0)
check_mgs_send_param();
check_hsm_user_request();
check_hsm_user_import();
+ CHECK_COND_STARTN(HAVE_NATIVE_LINUX_CLIENT);
check_netobj_s();
check_rawobj_s();
check_gss_header();
check_gss_rep_header();
check_gss_err_header();
check_gss_wire_ctx();
+ CHECK_COND_FINISH(HAVE_NATIVE_LINUX_CLIENT);
#ifndef HAVE_NATIVE_LINUX_CLIENT
- printf("#ifdef HAVE_SERVER_SUPPORT\n");
+ CHECK_COND_START(HAVE_SERVER_SUPPORT);
check_object_update_param();
check_object_update();
check_object_update_request();
check_update_ops();
check_update_records();
check_llog_update_record();
- printf("#endif /* HAVE_SERVER_SUPPORT */\n");
+ CHECK_COND_FINISH(HAVE_SERVER_SUPPORT);
#endif /* !HAVE_NATIVE_LINUX_CLIENT */
check_lustre_cfg();
(long long)(int)offsetof(struct lustre_som_attrs, lsa_blocks));
LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_blocks) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_blocks));
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct lustre_mdt_attrs */
Q_GETOQUOTA);
LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n",
Q_FINVALIDATE);
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct lquota_acct_rec */
(long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_pad2));
LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad2) == 8, "found %lld\n",
(long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad2));
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct ldlm_gl_barrier_desc */
LASSERTF((int)sizeof(((struct hsm_user_import *)0)->hui_archive_id) == 4, "found %lld\n",
(long long)(int)sizeof(((struct hsm_user_import *)0)->hui_archive_id));
+#ifndef HAVE_NATIVE_LINUX_CLIENT
+
/* Checks for struct netobj_s */
LASSERTF((int)sizeof(struct netobj_s) == 4, "found %lld\n",
(long long)(int)sizeof(struct netobj_s));
(long long)(int)offsetof(struct gss_wire_ctx, gw_handle));
LASSERTF((int)sizeof(((struct gss_wire_ctx *)0)->gw_handle) == 16, "found %lld\n",
(long long)(int)sizeof(((struct gss_wire_ctx *)0)->gw_handle));
+#endif /* HAVE_NATIVE_LINUX_CLIENT */
+
#ifdef HAVE_SERVER_SUPPORT
/* Checks for struct object_update_param */
(long long)(int)offsetof(struct nodemap_cluster_rec, ncr_name[16 + 1]));
LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_name[16 + 1]) == 1, "found %lld\n",
(long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_name[16 + 1]));
+ /* nodemap_cluster_rec.ncr_flags is a bitfield and cannot be checked */
+ /* nodemap_cluster_rec.ncr_flags2 is a bitfield and cannot be checked */
LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_padding1) == 19, "found %lld\n",
(long long)(int)offsetof(struct nodemap_cluster_rec, ncr_padding1));
LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding1) == 1, "found %lld\n",