From 9ef92397c3c8066310eb3952a9e3910374814844 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sat, 21 Aug 2021 13:54:42 -0400 Subject: [PATCH] LU-13903 utils: separate out server code for wiretest Both the kernel and userland utility wiretest is used by both client and server to validate data being sent over the network. Make userland wiretest buildable on the native Linux client which lacks server specific data structures. Use of the UAPI values to hardern testing of user land data passed to the kernel. Change-Id: I30efc8bf42ac461bab5a4371e940a027a23d12c9 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/43873 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- lustre/include/uapi/linux/lustre/lustre_idl.h | 16 ++- lustre/ptlrpc/wiretest.c | 105 ++++++++++++----- lustre/utils/liblustreapi_fid.c | 4 + lustre/utils/wirecheck.c | 156 +++++++++++++++++++++----- lustre/utils/wirehdr.c | 3 +- lustre/utils/wiretest.c | 109 +++++++++++++----- 6 files changed, 300 insertions(+), 93 deletions(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 7ea4f8b..e89a89b 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -281,8 +281,8 @@ enum fid_seq { FID_SEQ_OST_MDT0 = 0, FID_SEQ_LLOG = 1, /* unnamed llogs */ FID_SEQ_ECHO = 2, - FID_SEQ_UNUSED_START = 3, - FID_SEQ_UNUSED_END = 9, + FID_SEQ_UNUSED_START = 3, /* Unused */ + FID_SEQ_UNUSED_END = 9, /* Unused */ FID_SEQ_LLOG_NAME = 10, /* named llogs */ FID_SEQ_RSVD = 11, FID_SEQ_IGIF = 12, @@ -756,7 +756,9 @@ struct ptlrpc_body_v2 { /* was OBD_CONNECT_TRUNCLOCK 0x400ULL *locks on server for punch */ #define OBD_CONNECT_TRANSNO 0x800ULL /*replay sends init transno */ #define OBD_CONNECT_IBITS 0x1000ULL /* not checked in 2.11+ */ -#define OBD_CONNECT_BARRIER 0x2000ULL /* write barrier */ +#define OBD_CONNECT_BARRIER 0x2000ULL /* write barrier. Resevered to + * avoid use on client. + */ #define OBD_CONNECT_ATTRFID 0x4000ULL /*Server can GetAttr By Fid*/ #define OBD_CONNECT_NODEVOH 0x8000ULL /*No open hndl on specl nodes*/ #define OBD_CONNECT_RMT_CLIENT 0x10000ULL /* Remote client, never used @@ -2678,8 +2680,8 @@ enum llog_ctxt_id { /* for multiple changelog consumers */ LLOG_CHANGELOG_USER_ORIG_CTXT = 14, LLOG_AGENT_ORIG_CTXT = 15, /**< agent requests generation on cdt */ - LLOG_UPDATELOG_ORIG_CTXT = 16, /* update log */ - LLOG_UPDATELOG_REPL_CTXT = 17, /* update log */ + LLOG_UPDATELOG_ORIG_CTXT = 16, /* update log. reserve for the client */ + LLOG_UPDATELOG_REPL_CTXT = 17, /* update log. reserve for the client */ LLOG_MAX_CTXTS }; @@ -2723,7 +2725,9 @@ enum llog_op_type { CHANGELOG_USER_REC = LLOG_OP_MAGIC | 0x70000, CHANGELOG_USER_REC2 = LLOG_OP_MAGIC | 0x70002, HSM_AGENT_REC = LLOG_OP_MAGIC | 0x80000, - UPDATE_REC = LLOG_OP_MAGIC | 0xa0000, + UPDATE_REC = LLOG_OP_MAGIC | 0xa0000, /* Resevered to avoid + * use on client. + */ LLOG_HDR_MAGIC = LLOG_OP_MAGIC | 0x45539, LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b, }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 02352d6..5d9351d 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -281,6 +281,7 @@ void lustre_assert_wire_constants(void) (long long)SEQ_FIRST_OPC); LASSERTF(SEQ_LAST_OPC == 701, "found %lld\n", (long long)SEQ_LAST_OPC); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LFSCK_NOTIFY == 1101, "found %lld\n", (long long)LFSCK_NOTIFY); LASSERTF(LFSCK_QUERY == 1102, "found %lld\n", @@ -289,6 +290,7 @@ void lustre_assert_wire_constants(void) (long long)LFSCK_FIRST_OPC); LASSERTF(LFSCK_LAST_OPC == 1103, "found %lld\n", (long long)LFSCK_LAST_OPC); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(SEQ_ALLOC_SUPER == 0, "found %lld\n", (long long)SEQ_ALLOC_SUPER); LASSERTF(SEQ_ALLOC_META == 1, "found %lld\n", @@ -338,17 +340,19 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(LDLM_MAX_TYPE != 14); BUILD_BUG_ON(LUSTRE_RES_ID_SEQ_OFF != 0); BUILD_BUG_ON(LUSTRE_RES_ID_VER_OID_OFF != 1); + BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_SEQ_OFF != 2); + BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_VER_OID_OFF != 3); + BUILD_BUG_ON(LUSTRE_RES_ID_HSH_OFF != 3); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(OUT_UPDATE == 1000, "found %lld\n", (long long)OUT_UPDATE); LASSERTF(OUT_UPDATE_LAST_OPC == 1001, "found %lld\n", (long long)OUT_UPDATE_LAST_OPC); - BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_SEQ_OFF != 2); - BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_VER_OID_OFF != 3); - BUILD_BUG_ON(LUSTRE_RES_ID_HSH_OFF != 3); BUILD_BUG_ON(LQUOTA_TYPE_USR != 0); BUILD_BUG_ON(LQUOTA_TYPE_GRP != 1); BUILD_BUG_ON(LQUOTA_RES_MD != 1); BUILD_BUG_ON(LQUOTA_RES_DT != 2); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(OBD_PING == 400, "found %lld\n", (long long)OBD_PING); LASSERTF(OBD_IDX_READ == 403, "found %lld\n", @@ -415,6 +419,27 @@ void lustre_assert_wire_constants(void) LASSERTF(LU_SEQ_RANGE_OST == 1, "found %lld\n", (long long)LU_SEQ_RANGE_OST); + /* Checks for struct lustre_som_attrs */ + LASSERTF((int)sizeof(struct lustre_som_attrs) == 24, "found %lld\n", + (long long)(int)sizeof(struct lustre_som_attrs)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_valid) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_som_attrs, lsa_valid)); + LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_reserved) == 2, "found %lld\n", + (long long)(int)offsetof(struct lustre_som_attrs, lsa_reserved)); + LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved) == 6, "found %lld\n", + (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_size) == 8, "found %lld\n", + (long long)(int)offsetof(struct lustre_som_attrs, lsa_size)); + LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_size)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_blocks) == 16, "found %lld\n", + (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 */ LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 24, "found %lld\n", (long long)(int)sizeof(struct lustre_mdt_attrs)); @@ -519,26 +544,6 @@ void lustre_assert_wire_constants(void) LASSERTF(OUT_XATTR_LIST == 17, "found %lld\n", (long long)OUT_XATTR_LIST); - /* Checks for struct lustre_som_attrs */ - LASSERTF((int)sizeof(struct lustre_som_attrs) == 24, "found %lld\n", - (long long)(int)sizeof(struct lustre_som_attrs)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_valid) == 0, "found %lld\n", - (long long)(int)offsetof(struct lustre_som_attrs, lsa_valid)); - LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid) == 2, "found %lld\n", - (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_reserved) == 2, "found %lld\n", - (long long)(int)offsetof(struct lustre_som_attrs, lsa_reserved)); - LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved) == 6, "found %lld\n", - (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_size) == 8, "found %lld\n", - (long long)(int)offsetof(struct lustre_som_attrs, lsa_size)); - LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_size) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_size)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_blocks) == 16, "found %lld\n", - (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)); - /* Checks for struct hsm_attrs */ LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n", (long long)(int)sizeof(struct hsm_attrs)); @@ -558,6 +563,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver)); LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n", (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct ost_id */ LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n", @@ -606,12 +612,14 @@ void lustre_assert_wire_constants(void) (long long)FID_SEQ_QUOTA_GLB); LASSERTF(FID_SEQ_ROOT == 0x0000000200000007ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_ROOT); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(FID_SEQ_LAYOUT_RBTREE == 0x0000000200000008ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_LAYOUT_RBTREE); LASSERTF(FID_SEQ_UPDATE_LOG == 0x0000000200000009ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_UPDATE_LOG); LASSERTF(FID_SEQ_UPDATE_LOG_DIR == 0x000000020000000aULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_UPDATE_LOG_DIR); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_NORMAL); LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n", @@ -696,9 +704,11 @@ void lustre_assert_wire_constants(void) (long long)LDF_COLLIDE); LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n", (long long)LU_PAGE_SIZE); +#ifdef HAVE_SERVER_SUPPORT /* Checks for union lu_page */ LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n", (long long)(int)sizeof(union lu_page)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct lu_ladvise */ LASSERTF((int)sizeof(struct lu_ladvise) == 32, "found %lld\n", @@ -1632,8 +1642,10 @@ void lustre_assert_wire_constants(void) OBD_MD_FLCROSSREF); LASSERTF(OBD_MD_FLGETATTRLOCK == (0x0000200000000000ULL), "found 0x%.16llxULL\n", OBD_MD_FLGETATTRLOCK); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(OBD_MD_FLOBJCOUNT == (0x0000400000000000ULL), "found 0x%.16llxULL\n", OBD_MD_FLOBJCOUNT); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(OBD_MD_FLDATAVERSION == (0x0010000000000000ULL), "found 0x%.16llxULL\n", OBD_MD_FLDATAVERSION); LASSERTF(OBD_MD_CLOSE_INTENT_EXECED == (0x0020000000000000ULL), "found 0x%.16llxULL\n", @@ -1909,10 +1921,10 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_padding3)); LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding3) == 8, "found %lld\n", (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding3)); - LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15]) == 55, "found %lld\n", - (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15])); - LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15]) == 1, "found %lld\n", - (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15])); + LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15 + 1]) == 56, "found %lld\n", + (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15 + 1])); + LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15 + 1]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15 + 1])); LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_stripe_fids[0]) == 56, "found %lld\n", (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_stripe_fids[0])); LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_stripe_fids[0]) == 16, "found %lld\n", @@ -1926,7 +1938,6 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(LMV_HASH_FLAG_LOST_LMV != 0x10000000); BUILD_BUG_ON(LMV_HASH_FLAG_BAD_TYPE != 0x20000000); BUILD_BUG_ON(LMV_HASH_FLAG_MIGRATION != 0x80000000); - BUILD_BUG_ON(LMV_HASH_FLAG_MIGRATION != 0x80000000); BUILD_BUG_ON(LMV_CRUSH_PG_COUNT != 4096); /* Checks for struct obd_statfs */ @@ -2155,6 +2166,7 @@ void lustre_assert_wire_constants(void) Q_GETOQUOTA); LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n", Q_FINVALIDATE); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct lquota_acct_rec */ LASSERTF((int)sizeof(struct lquota_acct_rec) == 16, "found %lld\n", @@ -2283,6 +2295,7 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(II_FL_VARREC != 0x00000004); BUILD_BUG_ON(II_FL_NONUNQ != 0x00000008); BUILD_BUG_ON(II_FL_NOKEY != 0x00000010); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct niobuf_remote */ LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n", @@ -2588,16 +2601,20 @@ void lustre_assert_wire_constants(void) (unsigned)LUSTRE_NOATIME_FL); LASSERTF(LUSTRE_INDEX_FL == 0x00001000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_INDEX_FL); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LUSTRE_ORPHAN_FL == 0x00002000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_ORPHAN_FL); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_DIRSYNC_FL); LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_TOPDIR_FL); LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_INLINE_DATA_FL); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LUSTRE_SET_SYNC_FL == 0x00040000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_SET_SYNC_FL); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(LUSTRE_ENCRYPT_FL == 0x00800000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_ENCRYPT_FL); LASSERTF(MDS_INODELOCK_LOOKUP == 0x00000001UL, "found 0x%.8xUL\n", @@ -3556,10 +3573,17 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct ldlm_inodebits, bits)); LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->bits) == 8, "found %lld\n", (long long)(int)sizeof(((struct ldlm_inodebits *)0)->bits)); +#ifdef HAVE_SERVER_SUPPORT LASSERTF((int)offsetof(struct ldlm_inodebits, try_bits) == 8, "found %lld\n", (long long)(int)offsetof(struct ldlm_inodebits, try_bits)); LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->try_bits) == 8, "found %lld\n", (long long)(int)sizeof(((struct ldlm_inodebits *)0)->try_bits)); +#else + LASSERTF((int)offsetof(struct ldlm_inodebits, cancel_bits) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_inodebits, cancel_bits)); + LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->cancel_bits) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_inodebits *)0)->cancel_bits)); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF((int)offsetof(struct ldlm_inodebits, li_gid) == 16, "found %lld\n", (long long)(int)offsetof(struct ldlm_inodebits, li_gid)); LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->li_gid) == 8, "found %lld\n", @@ -3813,6 +3837,7 @@ void lustre_assert_wire_constants(void) (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 ldlm_gl_barrier_desc) == 16, "found %lld\n", @@ -3845,6 +3870,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct barrier_lvb, lvb_padding)); LASSERTF((int)sizeof(((struct barrier_lvb *)0)->lvb_padding) == 8, "found %lld\n", (long long)(int)sizeof(((struct barrier_lvb *)0)->lvb_padding)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_send_param */ LASSERTF((int)sizeof(struct mgs_send_param) == 1024, "found %lld\n", @@ -4051,6 +4077,7 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding3) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding3)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct llog_setattr64_rec */ LASSERTF((int)sizeof(struct llog_setattr64_rec) == 64, "found %lld\n", (long long)(int)sizeof(struct llog_setattr64_rec)); @@ -4134,6 +4161,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_tail)); LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct llog_size_change_rec */ LASSERTF((int)sizeof(struct llog_size_change_rec) == 64, "found %lld\n", @@ -4215,6 +4243,7 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct changelog_ext_rename *)0)->cr_spfid) == 16, "found %lld\n", (long long)(int)sizeof(((struct changelog_ext_rename *)0)->cr_spfid)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct changelog_ext_jobid */ LASSERTF((int)sizeof(struct changelog_ext_jobid) == 32, "found %lld\n", (long long)(int)sizeof(struct changelog_ext_jobid)); @@ -4223,6 +4252,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct changelog_ext_jobid, cr_jobid)); LASSERTF((int)sizeof(((struct changelog_ext_jobid *)0)->cr_jobid) == 32, "found %lld\n", (long long)(int)sizeof(((struct changelog_ext_jobid *)0)->cr_jobid)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct changelog_setinfo */ LASSERTF((int)sizeof(struct changelog_setinfo) == 12, "found %lld\n", @@ -4251,6 +4281,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_changelog_rec, cr_do_not_use)); LASSERTF((int)sizeof(((struct llog_changelog_rec *)0)->cr_do_not_use) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_changelog_rec *)0)->cr_do_not_use)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct llog_changelog_user_rec */ LASSERTF((int)sizeof(struct llog_changelog_user_rec) == 40, "found %lld\n", @@ -4275,6 +4306,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_changelog_user_rec, cur_tail)); LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_tail) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_tail)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct llog_gen */ LASSERTF((int)sizeof(struct llog_gen) == 16, "found %lld\n", @@ -4434,6 +4466,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct ll_fiemap_info_key, lfik_fiemap)); LASSERTF((int)sizeof(((struct ll_fiemap_info_key *)0)->lfik_fiemap) == 32, "found %lld\n", (long long)(int)sizeof(((struct ll_fiemap_info_key *)0)->lfik_fiemap)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct quota_body */ LASSERTF((int)sizeof(struct quota_body) == 112, "found %lld\n", @@ -4478,6 +4511,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct quota_body, qb_padding1[4])); LASSERTF((int)sizeof(((struct quota_body *)0)->qb_padding1[4]) == 8, "found %lld\n", (long long)(int)sizeof(((struct quota_body *)0)->qb_padding1[4])); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_target_info */ LASSERTF((int)sizeof(struct mgs_target_info) == 4544, "found %lld\n", @@ -4598,8 +4632,10 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(MGS_CFG_T_SPTLRPC != 1); BUILD_BUG_ON(MGS_CFG_T_RECOVER != 2); BUILD_BUG_ON(MGS_CFG_T_PARAMS != 3); +#ifdef HAVE_SERVER_SUPPORT BUILD_BUG_ON(MGS_CFG_T_NODEMAP != 4); BUILD_BUG_ON(MGS_CFG_T_BARRIER != 5); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_config_res */ LASSERTF((int)sizeof(struct mgs_config_res) == 16, "found %lld\n", @@ -4632,10 +4668,17 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct getinfo_fid2path, gf_pathlen)); LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_pathlen) == 4, "found %lld\n", (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_pathlen)); +#ifdef HAVE_FID2PATH_ANON_UNIONS + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_path[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_path[0])); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0])); +#else LASSERTF((int)offsetof(struct getinfo_fid2path, gf_u.gf_path[0]) == 32, "found %lld\n", (long long)(int)offsetof(struct getinfo_fid2path, gf_u.gf_path[0])); LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_u.gf_path[0]) == 1, "found %lld\n", (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_u.gf_path[0])); +#endif /* HAVE_FID2PATH_ANON_UNIONS */ /* Checks for struct fiemap */ LASSERTF((int)sizeof(struct fiemap) == 32, "found %lld\n", @@ -5134,6 +5177,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct hsm_user_import, hui_archive_id)); 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)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct object_update_param */ LASSERTF((int)sizeof(struct object_update_param) == 8, "found %lld\n", @@ -5551,14 +5595,12 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct lfsck_request, lr_padding_3)); LASSERTF((int)sizeof(((struct lfsck_request *)0)->lr_padding_3) == 8, "found %lld\n", (long long)(int)sizeof(((struct lfsck_request *)0)->lr_padding_3)); -#ifdef HAVE_SERVER_SUPPORT LASSERTF(LFSCK_TYPE_SCRUB == 0x00000000UL, "found 0x%.8xUL\n", (unsigned)LFSCK_TYPE_SCRUB); LASSERTF(LFSCK_TYPE_LAYOUT == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)LFSCK_TYPE_LAYOUT); LASSERTF(LFSCK_TYPE_NAMESPACE == 0x00000004UL, "found 0x%.8xUL\n", (unsigned)LFSCK_TYPE_NAMESPACE); -#endif LASSERTF(LE_LASTID_REBUILDING == 1, "found %lld\n", (long long)LE_LASTID_REBUILDING); LASSERTF(LE_LASTID_REBUILT == 2, "found %lld\n", @@ -5687,6 +5729,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_update_record, lur_update_rec)); LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_update_rec) == 32, "found %lld\n", (long long)(int)sizeof(((struct llog_update_record *)0)->lur_update_rec)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct lustre_cfg */ LASSERTF((int)sizeof(struct lustre_cfg) == 32, "found %lld\n", @@ -5781,6 +5824,7 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_PRE_CLEANUP); LASSERTF(LCFG_SET_PARAM == 0x000ce032UL, "found 0x%.8xUL\n", (unsigned)LCFG_SET_PARAM); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LCFG_NODEMAP_ADD == 0x000ce040UL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_ADD); LASSERTF(LCFG_NODEMAP_DEL == 0x000ce041UL, "found 0x%.8xUL\n", @@ -5825,6 +5869,7 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_NODEMAP_AUDIT_MODE); LASSERTF(LCFG_NODEMAP_SET_SEPOL == 0x000ce05bUL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_SET_SEPOL); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(PORTALS_CFG_TYPE == 1, "found %lld\n", (long long)PORTALS_CFG_TYPE); LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n", diff --git a/lustre/utils/liblustreapi_fid.c b/lustre/utils/liblustreapi_fid.c index 131f3cb..ac7911c 100644 --- a/lustre/utils/liblustreapi_fid.c +++ b/lustre/utils/liblustreapi_fid.c @@ -266,6 +266,7 @@ int llapi_get_mdt_index_by_fid(int fd, const struct lu_fid *fid, static int fid_from_lma(const char *path, int fd, struct lu_fid *fid) { +#ifdef HAVE_SERVER_SUPPORT struct lustre_mdt_attrs *lma; char buf[512]; int rc = -1; @@ -280,6 +281,9 @@ static int fid_from_lma(const char *path, int fd, struct lu_fid *fid) lma = (struct lustre_mdt_attrs *)buf; memcpy(fid, &lma->lma_self_fid, sizeof(lma->lma_self_fid)); return 0; +#else + return -ENOTSUP; +#endif } int llapi_fd2fid(int fd, struct lu_fid *fid) diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 342388b..3fa2d20 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -38,9 +38,11 @@ #include #include #include +#ifndef HAVE_NATIVE_LINUX_CLIENT #include #include #include +#endif #include #define BLANK_LINE() \ @@ -199,6 +201,7 @@ check_lu_seq_range(void) CHECK_VALUE(LU_SEQ_RANGE_OST); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_lustre_mdt_attrs(void) { @@ -236,6 +239,17 @@ check_lustre_ost_attrs(void) CHECK_MEMBER(lustre_ost_attrs, loa_comp_end); } +static void +check_hsm_attrs(void) +{ + BLANK_LINE(); + CHECK_STRUCT(hsm_attrs); + CHECK_MEMBER(hsm_attrs, hsm_compat); + CHECK_MEMBER(hsm_attrs, hsm_flags); + CHECK_MEMBER(hsm_attrs, hsm_arch_id); + CHECK_MEMBER(hsm_attrs, hsm_arch_ver); +} +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ static void check_som_attrs(void) @@ -249,17 +263,6 @@ check_som_attrs(void) } static void -check_hsm_attrs(void) -{ - BLANK_LINE(); - CHECK_STRUCT(hsm_attrs); - CHECK_MEMBER(hsm_attrs, hsm_compat); - CHECK_MEMBER(hsm_attrs, hsm_flags); - CHECK_MEMBER(hsm_attrs, hsm_arch_id); - CHECK_MEMBER(hsm_attrs, hsm_arch_ver); -} - -static void check_ost_id(void) { BLANK_LINE(); @@ -287,9 +290,13 @@ check_ost_id(void) CHECK_VALUE_64X(FID_SEQ_QUOTA); CHECK_VALUE_64X(FID_SEQ_QUOTA_GLB); CHECK_VALUE_64X(FID_SEQ_ROOT); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_VALUE_64X(FID_SEQ_LAYOUT_RBTREE); CHECK_VALUE_64X(FID_SEQ_UPDATE_LOG); CHECK_VALUE_64X(FID_SEQ_UPDATE_LOG_DIR); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* HAVE_NATIVE_LINUX_CLIENT */ CHECK_VALUE_64X(FID_SEQ_NORMAL); CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT); @@ -338,7 +345,11 @@ check_lu_dirpage(void) CHECK_VALUE(LDF_EMPTY); CHECK_VALUE(LDF_COLLIDE); CHECK_VALUE(LU_PAGE_SIZE); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_UNION(lu_page); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* HAVE_NATIVE_LINUX_CLIENT */ } static void @@ -729,7 +740,11 @@ check_obdo(void) CHECK_DEFINE_64X(OBD_MD_FLAGSTATFS); CHECK_DEFINE_64X(OBD_MD_FLCROSSREF); CHECK_DEFINE_64X(OBD_MD_FLGETATTRLOCK); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_DEFINE_64X(OBD_MD_FLOBJCOUNT); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* HAVE_NATIVE_LINUX_CLIENT */ CHECK_DEFINE_64X(OBD_MD_FLDATAVERSION); CHECK_DEFINE_64X(OBD_MD_CLOSE_INTENT_EXECED); CHECK_DEFINE_64X(OBD_MD_DEFAULT_MEA); @@ -863,6 +878,7 @@ check_lov_comp_md_v1(void) CHECK_VALUE(LCM_FL_RDONLY); CHECK_VALUE(LCM_FL_WRITE_PENDING); CHECK_VALUE(LCM_FL_SYNC_PENDING); + CHECK_VALUE(LCM_FL_PCC_RDONLY); } static void @@ -879,7 +895,7 @@ check_lmv_mds_md_v1(void) CHECK_MEMBER(lmv_mds_md_v1, lmv_migrate_hash); CHECK_MEMBER(lmv_mds_md_v1, lmv_padding2); CHECK_MEMBER(lmv_mds_md_v1, lmv_padding3); - CHECK_MEMBER(lmv_mds_md_v1, lmv_pool_name[LOV_MAXPOOLNAME]); + CHECK_MEMBER(lmv_mds_md_v1, lmv_pool_name[LOV_MAXPOOLNAME + 1]); CHECK_MEMBER(lmv_mds_md_v1, lmv_stripe_fids[0]); CHECK_CDEFINE(LMV_MAGIC_V1); @@ -943,7 +959,6 @@ check_obd_ioobj(void) static void check_obd_quotactl(void) { - BLANK_LINE(); CHECK_UNION(lquota_id); @@ -985,7 +1000,12 @@ check_obd_quotactl(void) CHECK_DEFINE_X(Q_GETOINFO); CHECK_DEFINE_X(Q_GETOQUOTA); CHECK_DEFINE_X(Q_FINVALIDATE); +} +#ifndef HAVE_NATIVE_LINUX_CLIENT +static void +check_obd_quotactl_server(void) +{ BLANK_LINE(); CHECK_STRUCT(lquota_acct_rec); CHECK_MEMBER(lquota_acct_rec, bspace); @@ -1001,7 +1021,6 @@ check_obd_quotactl(void) BLANK_LINE(); CHECK_STRUCT(lquota_slv_rec); CHECK_MEMBER(lquota_slv_rec, qsr_granted); - } static void @@ -1041,6 +1060,7 @@ check_obd_idx_read(void) CHECK_CVALUE_X(II_FL_NONUNQ); CHECK_CVALUE_X(II_FL_NOKEY); } +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ static void check_niobuf_remote(void) @@ -1183,11 +1203,19 @@ check_mdt_body(void) CHECK_VALUE_X(LUSTRE_NODUMP_FL); CHECK_VALUE_X(LUSTRE_NOATIME_FL); CHECK_VALUE_X(LUSTRE_INDEX_FL); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_VALUE_X(LUSTRE_ORPHAN_FL); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ CHECK_VALUE_X(LUSTRE_DIRSYNC_FL); CHECK_VALUE_X(LUSTRE_TOPDIR_FL); CHECK_VALUE_X(LUSTRE_INLINE_DATA_FL); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_VALUE_X(LUSTRE_SET_SYNC_FL); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ CHECK_VALUE_X(LUSTRE_ENCRYPT_FL); CHECK_VALUE_X(MDS_INODELOCK_LOOKUP); @@ -1519,7 +1547,15 @@ check_ldlm_inodebits(void) BLANK_LINE(); CHECK_STRUCT(ldlm_inodebits); CHECK_MEMBER(ldlm_inodebits, bits); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_MEMBER(ldlm_inodebits, try_bits); + printf("#else\n"); +#endif + CHECK_MEMBER(ldlm_inodebits, cancel_bits); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif CHECK_MEMBER(ldlm_inodebits, li_gid); } @@ -1654,6 +1690,7 @@ check_ldlm_gl_lquota_desc(void) CHECK_MEMBER(ldlm_gl_lquota_desc, gl_pad2); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_ldlm_gl_barrier_desc(void) { BLANK_LINE(); @@ -1671,6 +1708,7 @@ static void check_ldlm_barrier_lvb(void) CHECK_MEMBER(barrier_lvb, lvb_index); CHECK_MEMBER(barrier_lvb, lvb_padding); } +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0) static void @@ -1790,10 +1828,12 @@ check_llog_unlink64_rec(void) CHECK_MEMBER(llog_unlink64_rec, lur_padding3); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_llog_setattr64_rec(void) { BLANK_LINE(); + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_STRUCT(llog_setattr64_rec); CHECK_MEMBER(llog_setattr64_rec, lsr_hdr); CHECK_MEMBER(llog_setattr64_rec, lsr_oi); @@ -1817,7 +1857,9 @@ check_llog_setattr64_rec(void) CHECK_MEMBER(llog_setattr64_rec_v2, lsr_padding2); CHECK_MEMBER(llog_setattr64_rec_v2, lsr_padding3); CHECK_MEMBER(llog_setattr64_rec_v2, lsr_tail); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); } +#endif /* !CONFIG_FS_LUSTRE */ static void check_llog_size_change_rec(void) @@ -1857,14 +1899,18 @@ check_changelog_ext_rename(void) CHECK_MEMBER(changelog_ext_rename, cr_spfid); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_changelog_ext_jobid(void) { BLANK_LINE(); + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_STRUCT(changelog_ext_jobid); CHECK_CDEFINE(LUSTRE_JOBID_SIZE); CHECK_MEMBER(changelog_ext_jobid, cr_jobid); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); } +#endif static void check_changelog_setinfo(void) @@ -1885,9 +1931,11 @@ check_llog_changelog_rec(void) CHECK_MEMBER(llog_changelog_rec, cr_do_not_use); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_llog_changelog_user_rec(void) { + printf("#ifdef HAVE_SERVER_SUPPORT\n"); BLANK_LINE(); CHECK_STRUCT(llog_changelog_user_rec); CHECK_MEMBER(llog_changelog_user_rec, cur_hdr); @@ -1895,7 +1943,9 @@ check_llog_changelog_user_rec(void) CHECK_MEMBER(llog_changelog_user_rec, cur_time); CHECK_MEMBER(llog_changelog_user_rec, cur_endrec); CHECK_MEMBER(llog_changelog_user_rec, cur_tail); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); } +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ static void check_llog_gen(void) @@ -1999,9 +2049,11 @@ check_ll_fiemap_info_key(void) CHECK_MEMBER(ll_fiemap_info_key, lfik_fiemap); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_quota_body(void) { + printf("#ifdef HAVE_SERVER_SUPPORT\n"); BLANK_LINE(); CHECK_STRUCT(quota_body); CHECK_MEMBER(quota_body, qb_fid); @@ -2014,7 +2066,9 @@ check_quota_body(void) CHECK_MEMBER(quota_body, qb_lockh); CHECK_MEMBER(quota_body, qb_glb_lockh); CHECK_MEMBER(quota_body, qb_padding1[4]); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); } +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ static void check_mgs_target_info(void) @@ -2066,8 +2120,12 @@ check_mgs_config_body(void) CHECK_CVALUE(MGS_CFG_T_SPTLRPC); CHECK_CVALUE(MGS_CFG_T_RECOVER); CHECK_CVALUE(MGS_CFG_T_PARAMS); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_CVALUE(MGS_CFG_T_NODEMAP); CHECK_CVALUE(MGS_CFG_T_BARRIER); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ } static void @@ -2088,7 +2146,23 @@ check_getinfo_fid2path(void) CHECK_MEMBER(getinfo_fid2path, gf_recno); CHECK_MEMBER(getinfo_fid2path, gf_linkno); CHECK_MEMBER(getinfo_fid2path, gf_pathlen); + printf("#ifdef HAVE_FID2PATH_ANON_UNIONS\n"); +#ifdef HAVE_FID2PATH_ANON_UNIONS + CHECK_MEMBER(getinfo_fid2path, gf_path[0]); + printf("#else\n"); + printf(" LASSERTF((int)offsetof(struct getinfo_fid2path, gf_u.gf_path[0]) == 32, \"found %%lld\\n\",\n"); + printf(" (long long)(int)offsetof(struct getinfo_fid2path, gf_u.gf_path[0]));\n"); + printf(" LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_u.gf_path[0]) == 1, \"found %%lld\\n\",\n"); + printf(" (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_u.gf_path[0]));\n"); +#else + printf(" LASSERTF((int)offsetof(struct getinfo_fid2path, gf_path[0]) == 32, \"found %%lld\\n\",\n"); + printf(" (long long)(int)offsetof(struct getinfo_fid2path, gf_path[0]));\n"); + printf(" LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0]) == 1, \"found %%lld\\n\",\n"); + printf(" (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0]));\n"); + printf("#else\n"); CHECK_MEMBER(getinfo_fid2path, gf_u.gf_path[0]); +#endif + printf("#endif /* HAVE_FID2PATH_ANON_UNIONS */\n"); } /* We don't control the definitions of posix_acl_xattr_{entry,header} @@ -2378,6 +2452,7 @@ static void check_hsm_user_import(void) CHECK_MEMBER(hsm_user_import, hui_archive_id); } +#ifndef HAVE_NATIVE_LINUX_CLIENT static void check_object_update_param(void) { BLANK_LINE(); @@ -2568,11 +2643,9 @@ static void check_lfsck_request(void) CHECK_MEMBER(lfsck_request, lr_padding_1); CHECK_MEMBER(lfsck_request, lr_padding_2); CHECK_MEMBER(lfsck_request, lr_padding_3); - printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_VALUE_X(LFSCK_TYPE_SCRUB); CHECK_VALUE_X(LFSCK_TYPE_LAYOUT); CHECK_VALUE_X(LFSCK_TYPE_NAMESPACE); - printf("#endif\n"); CHECK_VALUE(LE_LASTID_REBUILDING); CHECK_VALUE(LE_LASTID_REBUILT); CHECK_VALUE(LE_PHASE1_DONE); @@ -2648,6 +2721,7 @@ static void check_llog_update_record(void) CHECK_MEMBER(llog_update_record, lur_hdr); CHECK_MEMBER(llog_update_record, lur_update_rec); } +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ static void check_lustre_cfg(void) @@ -2692,6 +2766,8 @@ check_lustre_cfg(void) CHECK_VALUE_X(LCFG_SET_LDLM_TIMEOUT); CHECK_VALUE_X(LCFG_PRE_CLEANUP); CHECK_VALUE_X(LCFG_SET_PARAM); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_VALUE_X(LCFG_NODEMAP_ADD); CHECK_VALUE_X(LCFG_NODEMAP_DEL); CHECK_VALUE_X(LCFG_NODEMAP_ADD_RANGE); @@ -2714,7 +2790,8 @@ check_lustre_cfg(void) CHECK_VALUE_X(LCFG_NODEMAP_MAP_MODE); CHECK_VALUE_X(LCFG_NODEMAP_AUDIT_MODE); CHECK_VALUE_X(LCFG_NODEMAP_SET_SEPOL); - + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ CHECK_VALUE(PORTALS_CFG_TYPE); CHECK_VALUE(LUSTRE_CFG_TYPE); } @@ -2863,11 +2940,14 @@ main(int argc, char **argv) CHECK_VALUE(SEQ_FIRST_OPC); CHECK_VALUE(SEQ_LAST_OPC); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); CHECK_VALUE(LFSCK_NOTIFY); CHECK_VALUE(LFSCK_QUERY); CHECK_VALUE(LFSCK_FIRST_OPC); CHECK_VALUE(LFSCK_LAST_OPC); - + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ CHECK_VALUE(SEQ_ALLOC_SUPER); CHECK_VALUE(SEQ_ALLOC_META); @@ -2901,19 +2981,21 @@ main(int argc, char **argv) CHECK_CVALUE(LUSTRE_RES_ID_SEQ_OFF); CHECK_CVALUE(LUSTRE_RES_ID_VER_OID_OFF); /* CHECK_CVALUE(LUSTRE_RES_ID_WAS_VER_OFF); packed with OID */ - - CHECK_VALUE(OUT_UPDATE); - CHECK_VALUE(OUT_UPDATE_LAST_OPC); CHECK_CVALUE(LUSTRE_RES_ID_QUOTA_SEQ_OFF); CHECK_CVALUE(LUSTRE_RES_ID_QUOTA_VER_OID_OFF); CHECK_CVALUE(LUSTRE_RES_ID_HSH_OFF); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); + CHECK_VALUE(OUT_UPDATE); + CHECK_VALUE(OUT_UPDATE_LAST_OPC); + CHECK_CVALUE(LQUOTA_TYPE_USR); CHECK_CVALUE(LQUOTA_TYPE_GRP); - CHECK_CVALUE(LQUOTA_RES_MD); CHECK_CVALUE(LQUOTA_RES_DT); - + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ CHECK_VALUE(OBD_PING); CHECK_VALUE(OBD_IDX_READ); CHECK_VALUE(OBD_LAST_OPC); @@ -2940,6 +3022,9 @@ main(int argc, char **argv) BLANK_LINE(); CHECK_STRUCT(obd_uuid); check_lu_seq_range(); + check_som_attrs(); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); check_lustre_mdt_attrs(); check_lustre_ost_attrs(); @@ -2962,8 +3047,9 @@ main(int argc, char **argv) CHECK_VALUE(OUT_NOOP); CHECK_VALUE(OUT_XATTR_LIST); - check_som_attrs(); check_hsm_attrs(); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_ost_id(); check_lu_dirent(); check_luda_type(); @@ -2985,7 +3071,12 @@ main(int argc, char **argv) check_obd_statfs(); check_obd_ioobj(); check_obd_quotactl(); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); + check_obd_quotactl_server(); check_obd_idx_read(); + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_niobuf_remote(); check_ost_body(); check_ll_fid(); @@ -3015,8 +3106,12 @@ main(int argc, char **argv) check_ldlm_ost_lvb(); check_ldlm_lquota_lvb(); check_ldlm_gl_lquota_desc(); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); check_ldlm_gl_barrier_desc(); check_ldlm_barrier_lvb(); +printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0) check_mgs_send_param(); #endif @@ -3028,21 +3123,29 @@ main(int argc, char **argv) check_llog_logid_rec(); check_llog_unlink_rec(); check_llog_unlink64_rec(); +#ifndef HAVE_NATIVE_LINUX_CLIENT check_llog_setattr64_rec(); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_llog_size_change_rec(); check_changelog_rec(); check_changelog_ext_rename(); +#ifndef HAVE_NATIVE_LINUX_CLIENT check_changelog_ext_jobid(); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_changelog_setinfo(); check_llog_changelog_rec(); +#ifndef HAVE_NATIVE_LINUX_CLIENT check_llog_changelog_user_rec(); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_llog_gen(); check_llog_gen_rec(); check_llog_log_hdr(); check_llogd_body(); check_llogd_conn_body(); check_ll_fiemap_info_key(); +#ifndef HAVE_NATIVE_LINUX_CLIENT check_quota_body(); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_mgs_target_info(); check_mgs_nidtbl_entry(); check_mgs_config_body(); @@ -3068,6 +3171,8 @@ main(int argc, char **argv) check_hsm_user_request(); check_hsm_user_import(); +#ifndef HAVE_NATIVE_LINUX_CLIENT + printf("#ifdef HAVE_SERVER_SUPPORT\n"); check_object_update_param(); check_object_update(); check_object_update_request(); @@ -3093,7 +3198,8 @@ main(int argc, char **argv) check_update_ops(); check_update_records(); check_llog_update_record(); - + printf("#endif /* HAVE_SERVER_SUPPORT */\n"); +#endif /* !HAVE_NATIVE_LINUX_CLIENT */ check_lustre_cfg(); printf("}\n"); diff --git a/lustre/utils/wirehdr.c b/lustre/utils/wirehdr.c index a8e307f..7fc30bf 100644 --- a/lustre/utils/wirehdr.c +++ b/lustre/utils/wirehdr.c @@ -35,8 +35,8 @@ #include #include -#include #ifdef HAVE_SERVER_SUPPORT +#include #include #include #ifdef CONFIG_FS_POSIX_ACL @@ -48,6 +48,7 @@ #endif /* CONFIG_FS_POSIX_ACL */ #endif /* HAVE_SERVER_SUPPORT */ #include +#include #ifndef BUILD_BUG_ON #define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2*!!(cond)])) diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index d368124..5503fd1 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -35,8 +35,8 @@ #include #include -#include #ifdef HAVE_SERVER_SUPPORT +#include #include #include #ifdef CONFIG_FS_POSIX_ACL @@ -48,6 +48,7 @@ #endif /* CONFIG_FS_POSIX_ACL */ #endif /* HAVE_SERVER_SUPPORT */ #include +#include #ifndef BUILD_BUG_ON #define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2*!!(cond)])) @@ -306,6 +307,7 @@ void lustre_assert_wire_constants(void) (long long)SEQ_FIRST_OPC); LASSERTF(SEQ_LAST_OPC == 701, "found %lld\n", (long long)SEQ_LAST_OPC); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LFSCK_NOTIFY == 1101, "found %lld\n", (long long)LFSCK_NOTIFY); LASSERTF(LFSCK_QUERY == 1102, "found %lld\n", @@ -314,6 +316,7 @@ void lustre_assert_wire_constants(void) (long long)LFSCK_FIRST_OPC); LASSERTF(LFSCK_LAST_OPC == 1103, "found %lld\n", (long long)LFSCK_LAST_OPC); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(SEQ_ALLOC_SUPER == 0, "found %lld\n", (long long)SEQ_ALLOC_SUPER); LASSERTF(SEQ_ALLOC_META == 1, "found %lld\n", @@ -363,17 +366,19 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(LDLM_MAX_TYPE != 14); BUILD_BUG_ON(LUSTRE_RES_ID_SEQ_OFF != 0); BUILD_BUG_ON(LUSTRE_RES_ID_VER_OID_OFF != 1); + BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_SEQ_OFF != 2); + BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_VER_OID_OFF != 3); + BUILD_BUG_ON(LUSTRE_RES_ID_HSH_OFF != 3); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(OUT_UPDATE == 1000, "found %lld\n", (long long)OUT_UPDATE); LASSERTF(OUT_UPDATE_LAST_OPC == 1001, "found %lld\n", (long long)OUT_UPDATE_LAST_OPC); - BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_SEQ_OFF != 2); - BUILD_BUG_ON(LUSTRE_RES_ID_QUOTA_VER_OID_OFF != 3); - BUILD_BUG_ON(LUSTRE_RES_ID_HSH_OFF != 3); BUILD_BUG_ON(LQUOTA_TYPE_USR != 0); BUILD_BUG_ON(LQUOTA_TYPE_GRP != 1); BUILD_BUG_ON(LQUOTA_RES_MD != 1); BUILD_BUG_ON(LQUOTA_RES_DT != 2); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(OBD_PING == 400, "found %lld\n", (long long)OBD_PING); LASSERTF(OBD_IDX_READ == 403, "found %lld\n", @@ -440,6 +445,27 @@ void lustre_assert_wire_constants(void) LASSERTF(LU_SEQ_RANGE_OST == 1, "found %lld\n", (long long)LU_SEQ_RANGE_OST); + /* Checks for struct lustre_som_attrs */ + LASSERTF((int)sizeof(struct lustre_som_attrs) == 24, "found %lld\n", + (long long)(int)sizeof(struct lustre_som_attrs)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_valid) == 0, "found %lld\n", + (long long)(int)offsetof(struct lustre_som_attrs, lsa_valid)); + LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid) == 2, "found %lld\n", + (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_reserved) == 2, "found %lld\n", + (long long)(int)offsetof(struct lustre_som_attrs, lsa_reserved)); + LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved) == 6, "found %lld\n", + (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_size) == 8, "found %lld\n", + (long long)(int)offsetof(struct lustre_som_attrs, lsa_size)); + LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_size) == 8, "found %lld\n", + (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_size)); + LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_blocks) == 16, "found %lld\n", + (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 */ LASSERTF((int)sizeof(struct lustre_mdt_attrs) == 24, "found %lld\n", (long long)(int)sizeof(struct lustre_mdt_attrs)); @@ -544,26 +570,6 @@ void lustre_assert_wire_constants(void) LASSERTF(OUT_XATTR_LIST == 17, "found %lld\n", (long long)OUT_XATTR_LIST); - /* Checks for struct lustre_som_attrs */ - LASSERTF((int)sizeof(struct lustre_som_attrs) == 24, "found %lld\n", - (long long)(int)sizeof(struct lustre_som_attrs)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_valid) == 0, "found %lld\n", - (long long)(int)offsetof(struct lustre_som_attrs, lsa_valid)); - LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid) == 2, "found %lld\n", - (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_valid)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_reserved) == 2, "found %lld\n", - (long long)(int)offsetof(struct lustre_som_attrs, lsa_reserved)); - LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved) == 6, "found %lld\n", - (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_reserved)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_size) == 8, "found %lld\n", - (long long)(int)offsetof(struct lustre_som_attrs, lsa_size)); - LASSERTF((int)sizeof(((struct lustre_som_attrs *)0)->lsa_size) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_som_attrs *)0)->lsa_size)); - LASSERTF((int)offsetof(struct lustre_som_attrs, lsa_blocks) == 16, "found %lld\n", - (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)); - /* Checks for struct hsm_attrs */ LASSERTF((int)sizeof(struct hsm_attrs) == 24, "found %lld\n", (long long)(int)sizeof(struct hsm_attrs)); @@ -583,6 +589,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct hsm_attrs, hsm_arch_ver)); LASSERTF((int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver) == 8, "found %lld\n", (long long)(int)sizeof(((struct hsm_attrs *)0)->hsm_arch_ver)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct ost_id */ LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n", @@ -631,12 +638,14 @@ void lustre_assert_wire_constants(void) (long long)FID_SEQ_QUOTA_GLB); LASSERTF(FID_SEQ_ROOT == 0x0000000200000007ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_ROOT); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(FID_SEQ_LAYOUT_RBTREE == 0x0000000200000008ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_LAYOUT_RBTREE); LASSERTF(FID_SEQ_UPDATE_LOG == 0x0000000200000009ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_UPDATE_LOG); LASSERTF(FID_SEQ_UPDATE_LOG_DIR == 0x000000020000000aULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_UPDATE_LOG_DIR); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n", (long long)FID_SEQ_NORMAL); LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n", @@ -721,9 +730,11 @@ void lustre_assert_wire_constants(void) (long long)LDF_COLLIDE); LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n", (long long)LU_PAGE_SIZE); +#ifdef HAVE_SERVER_SUPPORT /* Checks for union lu_page */ LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n", (long long)(int)sizeof(union lu_page)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct lu_ladvise */ LASSERTF((int)sizeof(struct lu_ladvise) == 32, "found %lld\n", @@ -1605,7 +1616,7 @@ void lustre_assert_wire_constants(void) OBD_MD_FLGID); LASSERTF(OBD_MD_FLFLAGS == (0x00000800ULL), "found 0x%.16llxULL\n", OBD_MD_FLFLAGS); - LASSERTF(OBD_MD_DOM_SIZE == (0X00001000ULL), "found 0x%.16llxULL\n", + LASSERTF(OBD_MD_DOM_SIZE == (0x00001000ULL), "found 0x%.16llxULL\n", OBD_MD_DOM_SIZE); LASSERTF(OBD_MD_FLNLINK == (0x00002000ULL), "found 0x%.16llxULL\n", OBD_MD_FLNLINK); @@ -1657,8 +1668,10 @@ void lustre_assert_wire_constants(void) OBD_MD_FLCROSSREF); LASSERTF(OBD_MD_FLGETATTRLOCK == (0x0000200000000000ULL), "found 0x%.16llxULL\n", OBD_MD_FLGETATTRLOCK); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(OBD_MD_FLOBJCOUNT == (0x0000400000000000ULL), "found 0x%.16llxULL\n", OBD_MD_FLOBJCOUNT); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(OBD_MD_FLDATAVERSION == (0x0010000000000000ULL), "found 0x%.16llxULL\n", OBD_MD_FLDATAVERSION); LASSERTF(OBD_MD_CLOSE_INTENT_EXECED == (0x0020000000000000ULL), "found 0x%.16llxULL\n", @@ -1934,10 +1947,10 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_padding3)); LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding3) == 8, "found %lld\n", (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding3)); - LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15]) == 55, "found %lld\n", - (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15])); - LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15]) == 1, "found %lld\n", - (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15])); + LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15 + 1]) == 56, "found %lld\n", + (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[15 + 1])); + LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15 + 1]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[15 + 1])); LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_stripe_fids[0]) == 56, "found %lld\n", (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_stripe_fids[0])); LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_stripe_fids[0]) == 16, "found %lld\n", @@ -2179,6 +2192,7 @@ void lustre_assert_wire_constants(void) Q_GETOQUOTA); LASSERTF(Q_FINVALIDATE == 0x800104, "found 0x%.8x\n", Q_FINVALIDATE); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct lquota_acct_rec */ LASSERTF((int)sizeof(struct lquota_acct_rec) == 16, "found %lld\n", @@ -2307,6 +2321,7 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(II_FL_VARREC != 0x00000004); BUILD_BUG_ON(II_FL_NONUNQ != 0x00000008); BUILD_BUG_ON(II_FL_NOKEY != 0x00000010); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct niobuf_remote */ LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n", @@ -2612,16 +2627,20 @@ void lustre_assert_wire_constants(void) (unsigned)LUSTRE_NOATIME_FL); LASSERTF(LUSTRE_INDEX_FL == 0x00001000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_INDEX_FL); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LUSTRE_ORPHAN_FL == 0x00002000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_ORPHAN_FL); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_DIRSYNC_FL); LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_TOPDIR_FL); LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_INLINE_DATA_FL); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LUSTRE_SET_SYNC_FL == 0x00040000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_SET_SYNC_FL); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(LUSTRE_ENCRYPT_FL == 0x00800000UL, "found 0x%.8xUL\n", (unsigned)LUSTRE_ENCRYPT_FL); LASSERTF(MDS_INODELOCK_LOOKUP == 0x00000001UL, "found 0x%.8xUL\n", @@ -3580,10 +3599,17 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct ldlm_inodebits, bits)); LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->bits) == 8, "found %lld\n", (long long)(int)sizeof(((struct ldlm_inodebits *)0)->bits)); +#ifdef HAVE_SERVER_SUPPORT LASSERTF((int)offsetof(struct ldlm_inodebits, try_bits) == 8, "found %lld\n", (long long)(int)offsetof(struct ldlm_inodebits, try_bits)); LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->try_bits) == 8, "found %lld\n", (long long)(int)sizeof(((struct ldlm_inodebits *)0)->try_bits)); +#else + LASSERTF((int)offsetof(struct ldlm_inodebits, cancel_bits) == 8, "found %lld\n", + (long long)(int)offsetof(struct ldlm_inodebits, cancel_bits)); + LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->cancel_bits) == 8, "found %lld\n", + (long long)(int)sizeof(((struct ldlm_inodebits *)0)->cancel_bits)); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF((int)offsetof(struct ldlm_inodebits, li_gid) == 16, "found %lld\n", (long long)(int)offsetof(struct ldlm_inodebits, li_gid)); LASSERTF((int)sizeof(((struct ldlm_inodebits *)0)->li_gid) == 8, "found %lld\n", @@ -3837,6 +3863,7 @@ void lustre_assert_wire_constants(void) (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 ldlm_gl_barrier_desc) == 16, "found %lld\n", @@ -3869,6 +3896,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct barrier_lvb, lvb_padding)); LASSERTF((int)sizeof(((struct barrier_lvb *)0)->lvb_padding) == 8, "found %lld\n", (long long)(int)sizeof(((struct barrier_lvb *)0)->lvb_padding)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_send_param */ LASSERTF((int)sizeof(struct mgs_send_param) == 1024, "found %lld\n", @@ -4075,6 +4103,7 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding3) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_unlink64_rec *)0)->lur_padding3)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct llog_setattr64_rec */ LASSERTF((int)sizeof(struct llog_setattr64_rec) == 64, "found %lld\n", (long long)(int)sizeof(struct llog_setattr64_rec)); @@ -4158,6 +4187,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_tail)); LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_tail)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct llog_size_change_rec */ LASSERTF((int)sizeof(struct llog_size_change_rec) == 64, "found %lld\n", @@ -4239,6 +4269,7 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct changelog_ext_rename *)0)->cr_spfid) == 16, "found %lld\n", (long long)(int)sizeof(((struct changelog_ext_rename *)0)->cr_spfid)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct changelog_ext_jobid */ LASSERTF((int)sizeof(struct changelog_ext_jobid) == 32, "found %lld\n", (long long)(int)sizeof(struct changelog_ext_jobid)); @@ -4247,6 +4278,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct changelog_ext_jobid, cr_jobid)); LASSERTF((int)sizeof(((struct changelog_ext_jobid *)0)->cr_jobid) == 32, "found %lld\n", (long long)(int)sizeof(((struct changelog_ext_jobid *)0)->cr_jobid)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct changelog_setinfo */ LASSERTF((int)sizeof(struct changelog_setinfo) == 12, "found %lld\n", @@ -4275,6 +4307,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_changelog_rec, cr_do_not_use)); LASSERTF((int)sizeof(((struct llog_changelog_rec *)0)->cr_do_not_use) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_changelog_rec *)0)->cr_do_not_use)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct llog_changelog_user_rec */ LASSERTF((int)sizeof(struct llog_changelog_user_rec) == 40, "found %lld\n", @@ -4299,6 +4332,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_changelog_user_rec, cur_tail)); LASSERTF((int)sizeof(((struct llog_changelog_user_rec *)0)->cur_tail) == 8, "found %lld\n", (long long)(int)sizeof(((struct llog_changelog_user_rec *)0)->cur_tail)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct llog_gen */ LASSERTF((int)sizeof(struct llog_gen) == 16, "found %lld\n", @@ -4458,6 +4492,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct ll_fiemap_info_key, lfik_fiemap)); LASSERTF((int)sizeof(((struct ll_fiemap_info_key *)0)->lfik_fiemap) == 32, "found %lld\n", (long long)(int)sizeof(((struct ll_fiemap_info_key *)0)->lfik_fiemap)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct quota_body */ LASSERTF((int)sizeof(struct quota_body) == 112, "found %lld\n", @@ -4502,6 +4537,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct quota_body, qb_padding1[4])); LASSERTF((int)sizeof(((struct quota_body *)0)->qb_padding1[4]) == 8, "found %lld\n", (long long)(int)sizeof(((struct quota_body *)0)->qb_padding1[4])); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_target_info */ LASSERTF((int)sizeof(struct mgs_target_info) == 4544, "found %lld\n", @@ -4622,8 +4658,10 @@ void lustre_assert_wire_constants(void) BUILD_BUG_ON(MGS_CFG_T_SPTLRPC != 1); BUILD_BUG_ON(MGS_CFG_T_RECOVER != 2); BUILD_BUG_ON(MGS_CFG_T_PARAMS != 3); +#ifdef HAVE_SERVER_SUPPORT BUILD_BUG_ON(MGS_CFG_T_NODEMAP != 4); BUILD_BUG_ON(MGS_CFG_T_BARRIER != 5); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct mgs_config_res */ LASSERTF((int)sizeof(struct mgs_config_res) == 16, "found %lld\n", @@ -4656,10 +4694,17 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct getinfo_fid2path, gf_pathlen)); LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_pathlen) == 4, "found %lld\n", (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_pathlen)); +#ifdef HAVE_FID2PATH_ANON_UNIONS + LASSERTF((int)offsetof(struct getinfo_fid2path, gf_path[0]) == 32, "found %lld\n", + (long long)(int)offsetof(struct getinfo_fid2path, gf_path[0])); + LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0]) == 1, "found %lld\n", + (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_path[0])); +#else LASSERTF((int)offsetof(struct getinfo_fid2path, gf_u.gf_path[0]) == 32, "found %lld\n", (long long)(int)offsetof(struct getinfo_fid2path, gf_u.gf_path[0])); LASSERTF((int)sizeof(((struct getinfo_fid2path *)0)->gf_u.gf_path[0]) == 1, "found %lld\n", (long long)(int)sizeof(((struct getinfo_fid2path *)0)->gf_u.gf_path[0])); +#endif /* HAVE_FID2PATH_ANON_UNIONS */ /* Checks for struct fiemap */ LASSERTF((int)sizeof(struct fiemap) == 32, "found %lld\n", @@ -5158,6 +5203,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct hsm_user_import, hui_archive_id)); 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)); +#ifdef HAVE_SERVER_SUPPORT /* Checks for struct object_update_param */ LASSERTF((int)sizeof(struct object_update_param) == 8, "found %lld\n", @@ -5575,14 +5621,12 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct lfsck_request, lr_padding_3)); LASSERTF((int)sizeof(((struct lfsck_request *)0)->lr_padding_3) == 8, "found %lld\n", (long long)(int)sizeof(((struct lfsck_request *)0)->lr_padding_3)); -#ifdef HAVE_SERVER_SUPPORT LASSERTF(LFSCK_TYPE_SCRUB == 0x00000000UL, "found 0x%.8xUL\n", (unsigned)LFSCK_TYPE_SCRUB); LASSERTF(LFSCK_TYPE_LAYOUT == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)LFSCK_TYPE_LAYOUT); LASSERTF(LFSCK_TYPE_NAMESPACE == 0x00000004UL, "found 0x%.8xUL\n", (unsigned)LFSCK_TYPE_NAMESPACE); -#endif LASSERTF(LE_LASTID_REBUILDING == 1, "found %lld\n", (long long)LE_LASTID_REBUILDING); LASSERTF(LE_LASTID_REBUILT == 2, "found %lld\n", @@ -5711,6 +5755,7 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct llog_update_record, lur_update_rec)); LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_update_rec) == 32, "found %lld\n", (long long)(int)sizeof(((struct llog_update_record *)0)->lur_update_rec)); +#endif /* HAVE_SERVER_SUPPORT */ /* Checks for struct lustre_cfg */ LASSERTF((int)sizeof(struct lustre_cfg) == 32, "found %lld\n", @@ -5805,6 +5850,7 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_PRE_CLEANUP); LASSERTF(LCFG_SET_PARAM == 0x000ce032UL, "found 0x%.8xUL\n", (unsigned)LCFG_SET_PARAM); +#ifdef HAVE_SERVER_SUPPORT LASSERTF(LCFG_NODEMAP_ADD == 0x000ce040UL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_ADD); LASSERTF(LCFG_NODEMAP_DEL == 0x000ce041UL, "found 0x%.8xUL\n", @@ -5849,6 +5895,7 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_NODEMAP_AUDIT_MODE); LASSERTF(LCFG_NODEMAP_SET_SEPOL == 0x000ce05bUL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_SET_SEPOL); +#endif /* HAVE_SERVER_SUPPORT */ LASSERTF(PORTALS_CFG_TYPE == 1, "found %lld\n", (long long)PORTALS_CFG_TYPE); LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n", -- 1.8.3.1