Whamcloud - gitweb
LU-6179 llite: remove LOCKAHEAD_OLD compatibility
[fs/lustre-release.git] / lustre / utils / wiretest.c
index 6d30541..b38f1fe 100644 (file)
 #ifdef HAVE_SERVER_SUPPORT
 #include <linux/lustre/lustre_lfsck_user.h>
 #include <linux/lustre/lustre_disk.h>
-#endif
+#ifdef CONFIG_FS_POSIX_ACL
+#include <linux/posix_acl_xattr.h>
+#ifdef HAVE_STRUCT_POSIX_ACL_XATTR
+# define posix_acl_xattr_header struct posix_acl_xattr_header
+# define posix_acl_xattr_entry  struct posix_acl_xattr_entry
+#endif /* HAVE_STRUCT_POSIX_ACL_XATTR */
+#endif /* CONFIG_FS_POSIX_ACL */
+#endif /* HAVE_SERVER_SUPPORT */
 #include <linux/lustre/lustre_cfg.h>
 
 #define LASSERT(cond) if (!(cond)) { printf("failed " #cond "\n"); ret = 1; }
@@ -52,7 +59,9 @@
  * ("(non-zero)" and "0").
  *
  */
+#ifndef BUILD_BUG_ON
 #define BUILD_BUG_ON(cond) do {switch (0) {case (cond): case 1: break; } } while (0)
+#endif
 
 int ret;
 
@@ -126,7 +135,9 @@ void lustre_assert_wire_constants(void)
                 (long long)OST_QUOTA_ADJUST_QUNIT);
        LASSERTF(OST_LADVISE == 21, "found %lld\n",
                 (long long)OST_LADVISE);
-       LASSERTF(OST_LAST_OPC == 22, "found %lld\n",
+       LASSERTF(OST_FALLOCATE == 22, "found %lld\n",
+                (long long)OST_FALLOCATE);
+       LASSERTF(OST_LAST_OPC == 23, "found %lld\n",
                 (long long)OST_LAST_OPC);
        LASSERTF(OBD_OBJECT_EOF == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
                 OBD_OBJECT_EOF);
@@ -459,6 +470,8 @@ void lustre_assert_wire_constants(void)
                (unsigned)LMAC_STRIPE_INFO);
        LASSERTF(LMAC_COMP_INFO == 0x00000020UL, "found 0x%.8xUL\n",
                (unsigned)LMAC_COMP_INFO);
+       LASSERTF(LMAC_IDX_BACKUP == 0x00000040UL, "found 0x%.8xUL\n",
+               (unsigned)LMAC_IDX_BACKUP);
        LASSERTF(LMAI_RELEASED == 0x00000001UL, "found 0x%.8xUL\n",
                (unsigned)LMAI_RELEASED);
        LASSERTF(LMAI_AGENT == 0x00000002UL, "found 0x%.8xUL\n",
@@ -593,6 +606,8 @@ void lustre_assert_wire_constants(void)
                 (long long)FID_SEQ_UNUSED_START);
        LASSERTF(FID_SEQ_UNUSED_END == 9, "found %lld\n",
                 (long long)FID_SEQ_UNUSED_END);
+       LASSERTF(FID_SEQ_LLOG_NAME == 10, "found %lld\n",
+                (long long)FID_SEQ_LLOG_NAME);
        LASSERTF(FID_SEQ_RSVD == 11, "found %lld\n",
                 (long long)FID_SEQ_RSVD);
        LASSERTF(FID_SEQ_IGIF == 12, "found %lld\n",
@@ -609,6 +624,8 @@ void lustre_assert_wire_constants(void)
                        (long long)FID_SEQ_LOCAL_FILE);
        LASSERTF(FID_SEQ_DOT_LUSTRE == 0x0000000200000002ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_DOT_LUSTRE);
+       LASSERTF(FID_SEQ_LOCAL_NAME == 0x0000000200000003ULL, "found 0x%.16llxULL\n",
+                       (long long)FID_SEQ_LOCAL_NAME);
        LASSERTF(FID_SEQ_SPECIAL == 0x0000000200000004ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_SPECIAL);
        LASSERTF(FID_SEQ_QUOTA == 0x0000000200000005ULL, "found 0x%.16llxULL\n",
@@ -633,6 +650,8 @@ void lustre_assert_wire_constants(void)
                (unsigned)FID_OID_DOT_LUSTRE);
        LASSERTF(FID_OID_DOT_LUSTRE_OBF == 0x00000002UL, "found 0x%.8xUL\n",
                (unsigned)FID_OID_DOT_LUSTRE_OBF);
+       LASSERTF(FID_OID_DOT_LUSTRE_LPF == 0x00000003UL, "found 0x%.8xUL\n",
+               (unsigned)FID_OID_DOT_LUSTRE_LPF);
 
        /* Checks for struct lu_dirent */
        LASSERTF((int)sizeof(struct lu_dirent) == 32, "found %lld\n",
@@ -744,6 +763,10 @@ void lustre_assert_wire_constants(void)
                 (long long)LU_LADVISE_WILLREAD);
        LASSERTF(LU_LADVISE_DONTNEED == 2, "found %lld\n",
                 (long long)LU_LADVISE_DONTNEED);
+       LASSERTF(LU_LADVISE_LOCKNOEXPAND == 3, "found %lld\n",
+                (long long)LU_LADVISE_LOCKNOEXPAND);
+       LASSERTF(LU_LADVISE_LOCKAHEAD == 4, "found %lld\n",
+                (long long)LU_LADVISE_LOCKAHEAD);
 
        /* Checks for struct ladvise_hdr */
        LASSERTF((int)sizeof(struct ladvise_hdr) == 32, "found %lld\n",
@@ -776,10 +799,9 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct ladvise_hdr, lah_advise));
        LASSERTF((int)sizeof(((struct ladvise_hdr *)0)->lah_advise) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct ladvise_hdr *)0)->lah_advise));
-       LASSERTF(LF_ASYNC == 1, "found %lld\n",
-                (long long)LF_ASYNC);
-       LASSERTF(LADVISE_MAGIC == 450829536, "found %lld\n",
-                (long long)LADVISE_MAGIC);
+       BUILD_BUG_ON(LF_ASYNC != 0x00000001);
+       BUILD_BUG_ON(LF_UNSET != 0x00000002);
+       BUILD_BUG_ON(LADVISE_MAGIC != 0x1adf1ce0);
 
        /* Checks for struct lustre_handle */
        LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
@@ -1328,6 +1350,8 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT_PINGLESS);
        LASSERTF(OBD_CONNECT_FLOCK_DEAD == 0x8000000000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT_FLOCK_DEAD);
+       LASSERTF(OBD_CONNECT_DISP_STRIPE == 0x10000000000000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT_DISP_STRIPE);
        LASSERTF(OBD_CONNECT_OPEN_BY_FID == 0x20000000000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT_OPEN_BY_FID);
        LASSERTF(OBD_CONNECT_LFSCK == 0x40000000000000ULL, "found 0x%.16llxULL\n",
@@ -1340,8 +1364,6 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT_DIR_STRIPE);
        LASSERTF(OBD_CONNECT_SUBTREE == 0x800000000000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT_SUBTREE);
-       LASSERTF(OBD_CONNECT_LOCKAHEAD_OLD == 0x1000000000000000ULL, "found 0x%.16llxULL\n",
-                OBD_CONNECT_LOCKAHEAD_OLD);
        LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT_BULK_MBITS);
        LASSERTF(OBD_CONNECT_OBDOPACK == 0x4000000000000000ULL, "found 0x%.16llxULL\n",
@@ -1374,6 +1396,8 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_LSOM);
        LASSERTF(OBD_CONNECT2_PCC == 0x1000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_PCC);
+       LASSERTF(OBD_CONNECT2_CRUSH == 0x2000ULL, "found 0x%.16llxULL\n",
+                OBD_CONNECT2_CRUSH);
        LASSERTF(OBD_CONNECT2_ASYNC_DISCARD == 0x4000ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ASYNC_DISCARD);
        LASSERTF(OBD_CONNECT2_ENCRYPT == 0x8000ULL, "found 0x%.16llxULL\n",
@@ -1568,6 +1592,8 @@ 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",
+                OBD_MD_DOM_SIZE);
        LASSERTF(OBD_MD_FLNLINK == (0x00002000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLNLINK);
        LASSERTF(OBD_MD_FLPARENT == (0x00004000ULL), "found 0x%.16llxULL\n",
@@ -1582,6 +1608,8 @@ void lustre_assert_wire_constants(void)
                 OBD_MD_FLHANDLE);
        LASSERTF(OBD_MD_FLCKSUM == (0x00100000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLCKSUM);
+       LASSERTF(OBD_MD_FLPRJQUOTA == (0x00400000ULL), "found 0x%.16llxULL\n",
+                OBD_MD_FLPRJQUOTA);
        LASSERTF(OBD_MD_FLGROUP == (0x01000000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLGROUP);
        LASSERTF(OBD_MD_FLFID == (0x02000000ULL), "found 0x%.16llxULL\n",
@@ -1610,10 +1638,14 @@ void lustre_assert_wire_constants(void)
                 OBD_MD_FLXATTRRM);
        LASSERTF(OBD_MD_FLACL == (0x0000008000000000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLACL);
+       LASSERTF(OBD_MD_FLAGSTATFS == (0x0000010000000000ULL), "found 0x%.16llxULL\n",
+                OBD_MD_FLAGSTATFS);
        LASSERTF(OBD_MD_FLCROSSREF == (0x0000100000000000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLCROSSREF);
        LASSERTF(OBD_MD_FLGETATTRLOCK == (0x0000200000000000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLGETATTRLOCK);
+       LASSERTF(OBD_MD_FLOBJCOUNT == (0x0000400000000000ULL), "found 0x%.16llxULL\n",
+                OBD_MD_FLOBJCOUNT);
        LASSERTF(OBD_MD_FLDATAVERSION == (0x0010000000000000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLDATAVERSION);
        LASSERTF(OBD_MD_CLOSE_INTENT_EXECED == (0x0020000000000000ULL), "found 0x%.16llxULL\n",
@@ -1624,6 +1656,12 @@ void lustre_assert_wire_constants(void)
                 OBD_MD_FLOSTLAYOUT);
        LASSERTF(OBD_MD_FLPROJID == (0x0100000000000000ULL), "found 0x%.16llxULL\n",
                 OBD_MD_FLPROJID);
+       LASSERTF(OBD_MD_SECCTX == (0x0200000000000000ULL), "found 0x%.16llxULL\n",
+                OBD_MD_SECCTX);
+       LASSERTF(OBD_MD_FLLAZYSIZE == (0x0400000000000000ULL), "found 0x%.16llxULL\n",
+                OBD_MD_FLLAZYSIZE);
+       LASSERTF(OBD_MD_FLLAZYBLOCKS == (0x0800000000000000ULL), "found 0x%.16llxULL\n",
+                OBD_MD_FLLAZYBLOCKS);
        BUILD_BUG_ON(OBD_FL_INLINEDATA != 0x00000001);
        BUILD_BUG_ON(OBD_FL_OBDMDEXISTS != 0x00000002);
        BUILD_BUG_ON(OBD_FL_DELORPHAN != 0x00000004);
@@ -1631,6 +1669,7 @@ void lustre_assert_wire_constants(void)
        BUILD_BUG_ON(OBD_FL_IDONLY != 0x00000010);
        BUILD_BUG_ON(OBD_FL_RECREATE_OBJS != 0x00000020);
        BUILD_BUG_ON(OBD_FL_DEBUG_CHECK != 0x00000040);
+       BUILD_BUG_ON(OBD_FL_NO_PRJQUOTA != 0x00000080);
        BUILD_BUG_ON(OBD_FL_NO_USRQUOTA != 0x00000100);
        BUILD_BUG_ON(OBD_FL_NO_GRPQUOTA != 0x00000200);
        BUILD_BUG_ON(OBD_FL_CREATE_CROW != 0x00000400);
@@ -1780,10 +1819,15 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct lov_comp_md_entry_v1, lcme_padding_1));
        LASSERTF((int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_padding_1) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct lov_comp_md_entry_v1 *)0)->lcme_padding_1));
-       LASSERTF(LCME_FL_INIT == 0x00000010UL, "found 0x%.8xUL\n",
-               (unsigned)LCME_FL_INIT);
-       LASSERTF(LCME_FL_NEG == 0x80000000UL, "found 0x%.8xUL\n",
-               (unsigned)LCME_FL_NEG);
+       BUILD_BUG_ON(LCME_FL_STALE != 0x00000001);
+       BUILD_BUG_ON(LCME_FL_PREF_RD != 0x00000002);
+       BUILD_BUG_ON(LCME_FL_PREF_WR != 0x00000004);
+       BUILD_BUG_ON(LCME_FL_PREF_RW != 0x00000006);
+       BUILD_BUG_ON(LCME_FL_OFFLINE != 0x00000008);
+       BUILD_BUG_ON(LCME_FL_INIT != 0x00000010);
+       BUILD_BUG_ON(LCME_FL_NOSYNC != 0x00000020);
+       BUILD_BUG_ON(LCME_FL_EXTENSION != 0x00000040);
+       BUILD_BUG_ON(LCME_FL_NEG != 0x80000000);
 
        /* Checks for struct lov_comp_md_v1 */
        LASSERTF((int)sizeof(struct lov_comp_md_v1) == 32, "found %lld\n",
@@ -1887,6 +1931,7 @@ 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_CRUSH_PG_COUNT != 4096);
 
        /* Checks for struct obd_statfs */
        LASSERTF((int)sizeof(struct obd_statfs) == 144, "found %lld\n",
@@ -1971,6 +2016,20 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct obd_statfs, os_spare9));
        LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare9) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare9));
+       LASSERTF(OS_STATE_DEGRADED == 0x00000001UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_DEGRADED);
+       LASSERTF(OS_STATE_READONLY == 0x00000002UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_READONLY);
+       LASSERTF(OS_STATE_NOPRECREATE == 0x00000004UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_NOPRECREATE);
+       LASSERTF(OS_STATE_ENOSPC == 0x00000020UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_ENOSPC);
+       LASSERTF(OS_STATE_ENOINO == 0x00000040UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_ENOINO);
+       LASSERTF(OS_STATE_SUM == 0x00000100UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_SUM);
+       LASSERTF(OS_STATE_NONROT == 0x00000200UL, "found 0x%.8xUL\n",
+               (unsigned)OS_STATE_NONROT);
 
        /* Checks for struct obd_ioobj */
        LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n",
@@ -2222,16 +2281,12 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(((struct lu_idxpage *)0)->lip_pad0) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct lu_idxpage *)0)->lip_pad0));
        BUILD_BUG_ON(LIP_MAGIC != 0x8A6D6B6C);
-       LASSERTF(LIP_HDR_SIZE == 16, "found %lld\n",
-                (long long)LIP_HDR_SIZE);
-       LASSERTF(II_FL_NOHASH == 1, "found %lld\n",
-                (long long)II_FL_NOHASH);
-       LASSERTF(II_FL_VARKEY == 2, "found %lld\n",
-                (long long)II_FL_VARKEY);
-       LASSERTF(II_FL_VARREC == 4, "found %lld\n",
-                (long long)II_FL_VARREC);
-       LASSERTF(II_FL_NONUNQ == 8, "found %lld\n",
-                (long long)II_FL_NONUNQ);
+       BUILD_BUG_ON(LIP_HDR_SIZE != (__builtin_offsetof (struct lu_idxpage, lip_entries)));
+       BUILD_BUG_ON(II_FL_NOHASH != 0x00000001);
+       BUILD_BUG_ON(II_FL_VARKEY != 0x00000002);
+       BUILD_BUG_ON(II_FL_VARREC != 0x00000004);
+       BUILD_BUG_ON(II_FL_NONUNQ != 0x00000008);
+       BUILD_BUG_ON(II_FL_NOKEY != 0x00000010);
 
        /* Checks for struct niobuf_remote */
        LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n",
@@ -2252,6 +2307,8 @@ void lustre_assert_wire_constants(void)
                OBD_BRW_READ);
        LASSERTF(OBD_BRW_WRITE == 0x02, "found 0x%.8x\n",
                OBD_BRW_WRITE);
+       LASSERTF(OBD_BRW_NDELAY == 0x04, "found 0x%.8x\n",
+               OBD_BRW_NDELAY);
        LASSERTF(OBD_BRW_SYNC == 0x08, "found 0x%.8x\n",
                OBD_BRW_SYNC);
        LASSERTF(OBD_BRW_CHECK == 0x10, "found 0x%.8x\n",
@@ -2276,6 +2333,10 @@ void lustre_assert_wire_constants(void)
                OBD_BRW_OVER_GRPQUOTA);
        LASSERTF(OBD_BRW_SOFT_SYNC == 0x4000, "found 0x%.8x\n",
                OBD_BRW_SOFT_SYNC);
+       LASSERTF(OBD_BRW_OVER_PRJQUOTA == 0x8000, "found 0x%.8x\n",
+               OBD_BRW_OVER_PRJQUOTA);
+       LASSERTF(OBD_BRW_RDMA_ONLY == 0x20000, "found 0x%.8x\n",
+               OBD_BRW_RDMA_ONLY);
 
        /* Checks for struct ost_body */
        LASSERTF((int)sizeof(struct ost_body) == 208, "found %lld\n",
@@ -2327,6 +2388,12 @@ void lustre_assert_wire_constants(void)
                (unsigned)MDS_CLOSE_RESYNC_DONE);
        LASSERTF(MDS_CLOSE_LAYOUT_SPLIT == 0x00020000UL, "found 0x%.8xUL\n",
                (unsigned)MDS_CLOSE_LAYOUT_SPLIT);
+       LASSERTF(MDS_TRUNC_KEEP_LEASE == 0x00040000UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_TRUNC_KEEP_LEASE);
+       LASSERTF(MDS_PCC_ATTACH == 0x00080000UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_PCC_ATTACH);
+       LASSERTF(MDS_CLOSE_UPDATE_TIMES == 0x00100000UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_CLOSE_UPDATE_TIMES);
 
        /* Checks for struct mdt_body */
        LASSERTF((int)sizeof(struct mdt_body) == 216, "found %lld\n",
@@ -2505,6 +2572,12 @@ void lustre_assert_wire_constants(void)
                        (long long)MDS_OPEN_NEWSTRIPE);
        LASSERTF(MDS_OPEN_VOLATILE == 00000000000400000000000ULL, "found 0%.22lloULL\n",
                        (long long)MDS_OPEN_VOLATILE);
+       LASSERTF(MDS_OPEN_LEASE == 00000000001000000000000ULL, "found 0%.22lloULL\n",
+                       (long long)MDS_OPEN_LEASE);
+       LASSERTF(MDS_OPEN_RESYNC == 00000000004000000000000ULL, "found 0%.22lloULL\n",
+                       (long long)MDS_OPEN_RESYNC);
+       LASSERTF(MDS_OPEN_PCC == 00000000010000000000000ULL, "found 0%.22lloULL\n",
+                       (long long)MDS_OPEN_PCC);
        LASSERTF(LUSTRE_SYNC_FL == 0x00000008UL, "found 0x%.8xUL\n",
                (unsigned)LUSTRE_SYNC_FL);
        LASSERTF(LUSTRE_IMMUTABLE_FL == 0x00000010UL, "found 0x%.8xUL\n",
@@ -2523,24 +2596,24 @@ void lustre_assert_wire_constants(void)
                (unsigned)LUSTRE_DIRSYNC_FL);
        LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000UL, "found 0x%.8xUL\n",
                (unsigned)LUSTRE_TOPDIR_FL);
-       LASSERTF(LUSTRE_DIRECTIO_FL == 0x00100000UL, "found 0x%.8xUL\n",
-               (unsigned)LUSTRE_DIRECTIO_FL);
        LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000UL, "found 0x%.8xUL\n",
                (unsigned)LUSTRE_INLINE_DATA_FL);
-       LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
-               MDS_INODELOCK_LOOKUP);
-       LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",
-               MDS_INODELOCK_UPDATE);
-       LASSERTF(MDS_INODELOCK_OPEN == 0x000004, "found 0x%.8x\n",
-               MDS_INODELOCK_OPEN);
-       LASSERTF(MDS_INODELOCK_LAYOUT == 0x000008, "found 0x%.8x\n",
-               MDS_INODELOCK_LAYOUT);
-       LASSERTF(MDS_INODELOCK_PERM == 0x000010, "found 0x%.8x\n",
-               MDS_INODELOCK_PERM);
-       LASSERTF(MDS_INODELOCK_XATTR == 0x000020, "found 0x%.8x\n",
-               MDS_INODELOCK_XATTR);
-       LASSERTF(MDS_INODELOCK_DOM == 0x000040, "found 0x%.8x\n",
-               MDS_INODELOCK_DOM);
+       LASSERTF(LUSTRE_SET_SYNC_FL == 0x00040000UL, "found 0x%.8xUL\n",
+               (unsigned)LUSTRE_SET_SYNC_FL);
+       LASSERTF(MDS_INODELOCK_LOOKUP == 0x00000001UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_LOOKUP);
+       LASSERTF(MDS_INODELOCK_UPDATE == 0x00000002UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_UPDATE);
+       LASSERTF(MDS_INODELOCK_OPEN == 0x00000004UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_OPEN);
+       LASSERTF(MDS_INODELOCK_LAYOUT == 0x00000008UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_LAYOUT);
+       LASSERTF(MDS_INODELOCK_PERM == 0x00000010UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_PERM);
+       LASSERTF(MDS_INODELOCK_XATTR == 0x00000020UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_XATTR);
+       LASSERTF(MDS_INODELOCK_DOM == 0x00000040UL, "found 0x%.8xUL\n",
+               (unsigned)MDS_INODELOCK_DOM);
 
        /* Checks for struct mdt_ioepoch */
        LASSERTF((int)sizeof(struct mdt_ioepoch) == 24, "found %lld\n",
@@ -3205,6 +3278,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct mdt_rec_resync, rs_padding0));
        LASSERTF((int)sizeof(((struct mdt_rec_resync *)0)->rs_padding0) == 16, "found %lld\n",
                 (long long)(int)sizeof(((struct mdt_rec_resync *)0)->rs_padding0));
+       LASSERTF((int)offsetof(struct mdt_rec_resync, rs_lease_handle) == 72, "found %lld\n",
+                (long long)(int)offsetof(struct mdt_rec_resync, rs_lease_handle));
+       LASSERTF((int)sizeof(((struct mdt_rec_resync *)0)->rs_lease_handle) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct mdt_rec_resync *)0)->rs_lease_handle));
        LASSERTF((int)offsetof(struct mdt_rec_resync, rs_padding1) == 80, "found %lld\n",
                 (long long)(int)offsetof(struct mdt_rec_resync, rs_padding1));
        LASSERTF((int)sizeof(((struct mdt_rec_resync *)0)->rs_padding1) == 8, "found %lld\n",
@@ -3515,24 +3592,17 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct ldlm_intent, opc));
        LASSERTF((int)sizeof(((struct ldlm_intent *)0)->opc) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct ldlm_intent *)0)->opc));
-       LASSERTF(IT_OPEN == 1, "found %lld\n",
-                (long long)IT_OPEN);
-       LASSERTF(IT_CREAT == 2, "found %lld\n",
-                (long long)IT_CREAT);
-       LASSERTF(IT_READDIR == 4, "found %lld\n",
-                (long long)IT_READDIR);
-       LASSERTF(IT_GETATTR == 8, "found %lld\n",
-                (long long)IT_GETATTR);
-       LASSERTF(IT_LOOKUP == 16, "found %lld\n",
-                (long long)IT_LOOKUP);
-       LASSERTF(IT_GETXATTR == 128, "found %lld\n",
-                (long long)IT_GETXATTR);
-       LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
-                (long long)IT_LAYOUT);
-       LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
-                (long long)IT_QUOTA_DQACQ);
-       LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
-                (long long)IT_QUOTA_CONN);
+       BUILD_BUG_ON(IT_OPEN != 0x00000001);
+       BUILD_BUG_ON(IT_CREAT != 0x00000002);
+       BUILD_BUG_ON(IT_READDIR != 0x00000004);
+       BUILD_BUG_ON(IT_GETATTR != 0x00000008);
+       BUILD_BUG_ON(IT_LOOKUP != 0x00000010);
+       BUILD_BUG_ON(IT_GETXATTR != 0x00000080);
+       BUILD_BUG_ON(IT_LAYOUT != 0x00000400);
+       BUILD_BUG_ON(IT_QUOTA_DQACQ != 0x00000800);
+       BUILD_BUG_ON(IT_QUOTA_CONN != 0x00001000);
+       BUILD_BUG_ON(IT_GLIMPSE != 0x00004000);
+       BUILD_BUG_ON(IT_BRW != 0x00008000);
 
        /* Checks for struct ldlm_resource_desc */
        LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",
@@ -3772,15 +3842,6 @@ void lustre_assert_wire_constants(void)
        LASSERTF((int)sizeof(((struct barrier_lvb *)0)->lvb_padding) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct barrier_lvb *)0)->lvb_padding));
 
-       /* Checks for struct mgs_send_param */
-       LASSERTF((int)sizeof(struct mgs_send_param) == 1024, "found %lld\n",
-                (long long)(int)sizeof(struct mgs_send_param));
-       BUILD_BUG_ON(MGS_PARAM_MAXLEN != 1024);
-       LASSERTF((int)offsetof(struct mgs_send_param, mgs_param[1024]) == 1024, "found %lld\n",
-                (long long)(int)offsetof(struct mgs_send_param, mgs_param[1024]));
-       LASSERTF((int)sizeof(((struct mgs_send_param *)0)->mgs_param[1024]) == 1, "found %lld\n",
-                (long long)(int)sizeof(((struct mgs_send_param *)0)->mgs_param[1024]));
-
        /* Checks for struct cfg_marker */
        LASSERTF((int)sizeof(struct cfg_marker) == 160, "found %lld\n",
                 (long long)(int)sizeof(struct cfg_marker));
@@ -3836,6 +3897,8 @@ void lustre_assert_wire_constants(void)
        BUILD_BUG_ON(LLOG_GEN_REC != 274989056);
        BUILD_BUG_ON(CHANGELOG_REC != 275120128);
        BUILD_BUG_ON(CHANGELOG_USER_REC != 275185664);
+       BUILD_BUG_ON(HSM_AGENT_REC != 275251200);
+       BUILD_BUG_ON(UPDATE_REC != 275382272);
        BUILD_BUG_ON(LLOG_HDR_MAGIC != 275010873);
        BUILD_BUG_ON(LLOG_LOGID_MAGIC != 275010875);
 
@@ -4009,10 +4072,54 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_tail));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_tail));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_hdr) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_hdr), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_hdr), (int)offsetof(struct llog_setattr64_rec_v2, lsr_hdr));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_hdr), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_hdr));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oi) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_oi), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_oi), (int)offsetof(struct llog_setattr64_rec_v2, lsr_oi));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_oi), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_oi));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_uid), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_uid), (int)offsetof(struct llog_setattr64_rec_v2, lsr_uid));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_uid), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_uid));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid_h) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_uid_h), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_uid_h), (int)offsetof(struct llog_setattr64_rec_v2, lsr_uid_h));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid_h) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_uid_h), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid_h), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_uid_h));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_gid) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_gid), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_gid), (int)offsetof(struct llog_setattr64_rec_v2, lsr_gid));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_gid), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_gid));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_gid_h) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_gid_h), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_gid_h), (int)offsetof(struct llog_setattr64_rec_v2, lsr_gid_h));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid_h) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_gid_h), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_gid_h), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_gid_h));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_valid) == (int)offsetof(struct llog_setattr64_rec_v2, lsr_valid), "%d != %d\n",
+                (int)offsetof(struct llog_setattr64_rec, lsr_valid), (int)offsetof(struct llog_setattr64_rec_v2, lsr_valid));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_valid) == (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_valid), "%d != %d\n",
+                (int)sizeof(((struct llog_setattr64_rec *)0)->lsr_valid), (int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_valid));
        LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_projid) == 56, "found %lld\n",
                 (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_projid));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_projid) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_projid));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_layout_version) == 60, "found %lld\n",
+                (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_layout_version));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_layout_version) == 4, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_layout_version));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_padding2) == 64, "found %lld\n",
+                (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_padding2));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_padding2) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_padding2));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_padding3) == 72, "found %lld\n",
+                (long long)(int)offsetof(struct llog_setattr64_rec_v2, lsr_padding3));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_padding3) == 8, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_setattr64_rec_v2 *)0)->lsr_padding3));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec_v2, lsr_tail) == 80, "found %lld\n",
+                (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));
 
        /* Checks for struct llog_size_change_rec */
        LASSERTF((int)sizeof(struct llog_size_change_rec) == 64, "found %lld\n",
@@ -4097,6 +4204,7 @@ void lustre_assert_wire_constants(void)
        /* 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));
+       BUILD_BUG_ON(LUSTRE_JOBID_SIZE != 32);
        LASSERTF((int)offsetof(struct changelog_ext_jobid, cr_jobid) == 0, "found %lld\n",
                 (long long)(int)offsetof(struct changelog_ext_jobid, cr_jobid));
        LASSERTF((int)sizeof(((struct changelog_ext_jobid *)0)->cr_jobid) == 32, "found %lld\n",
@@ -4217,6 +4325,16 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct llog_log_hdr, llh_tgtuuid));
        LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid));
+       BUILD_BUG_ON(LLOG_F_ZAP_WHEN_EMPTY != 0x00000001);
+       BUILD_BUG_ON(LLOG_F_IS_CAT != 0x00000002);
+       BUILD_BUG_ON(LLOG_F_IS_PLAIN != 0x00000004);
+       BUILD_BUG_ON(LLOG_F_EXT_JOBID != 0x00000008);
+       BUILD_BUG_ON(LLOG_F_IS_FIXSIZE != 0x00000010);
+       BUILD_BUG_ON(LLOG_F_EXT_EXTRA_FLAGS != 0x00000020);
+       BUILD_BUG_ON(LLOG_F_EXT_X_UIDGID != 0x00000040);
+       BUILD_BUG_ON(LLOG_F_EXT_X_NID != 0x00000080);
+       BUILD_BUG_ON(LLOG_F_EXT_X_OMODE != 0x00000100);
+       BUILD_BUG_ON(LLOG_F_EXT_X_XATTR != 0x00000200);
 
        /* Checks for struct llogd_body */
        LASSERTF((int)sizeof(struct llogd_body) == 48, "found %lld\n",
@@ -4481,68 +4599,6 @@ void lustre_assert_wire_constants(void)
        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));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_fid) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_fid));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_fid) == 16, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_fid));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_opc) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_opc));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_opc) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_opc));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_uid) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_uid));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_uid) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_uid));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_gid) == 32, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_gid));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_gid) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_gid));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_flags) == 40, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_flags));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_flags) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_flags));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_keyid) == 44, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_keyid));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_keyid) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_keyid));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_timeout) == 48, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_timeout));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_timeout) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_timeout));
-       LASSERTF((int)offsetof(struct lustre_capa, lc_expiry) == 52, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_expiry));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_expiry) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_expiry));
-       BUILD_BUG_ON(CAPA_HMAC_MAX_LEN != 64);
-       LASSERTF((int)offsetof(struct lustre_capa, lc_hmac[64]) == 120, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa, lc_hmac[64]));
-       LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_hmac[64]) == 1, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa *)0)->lc_hmac[64]));
-
-       /* Checks for struct lustre_capa_key */
-       LASSERTF((int)sizeof(struct lustre_capa_key) == 72, "found %lld\n",
-                (long long)(int)sizeof(struct lustre_capa_key));
-       LASSERTF((int)offsetof(struct lustre_capa_key, lk_seq) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa_key, lk_seq));
-       LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_seq));
-       LASSERTF((int)offsetof(struct lustre_capa_key, lk_keyid) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa_key, lk_keyid));
-       LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_keyid) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_keyid));
-       LASSERTF((int)offsetof(struct lustre_capa_key, lk_padding) == 12, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa_key, lk_padding));
-       LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_padding) == 4, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_padding));
-       BUILD_BUG_ON(CAPA_HMAC_KEY_MAX_LEN != 56);
-       LASSERTF((int)offsetof(struct lustre_capa_key, lk_key[56]) == 72, "found %lld\n",
-                (long long)(int)offsetof(struct lustre_capa_key, lk_key[56]));
-       LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_key[56]) == 1, "found %lld\n",
-                (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_key[56]));
-
        /* Checks for struct getinfo_fid2path */
        LASSERTF((int)sizeof(struct getinfo_fid2path) == 32, "found %lld\n",
                 (long long)(int)sizeof(struct getinfo_fid2path));
@@ -4635,6 +4691,7 @@ void lustre_assert_wire_constants(void)
        BUILD_BUG_ON(FIEMAP_EXTENT_DATA_TAIL != 0x00000400);
        BUILD_BUG_ON(FIEMAP_EXTENT_UNWRITTEN != 0x00000800);
        BUILD_BUG_ON(FIEMAP_EXTENT_MERGED != 0x00001000);
+       BUILD_BUG_ON(FIEMAP_EXTENT_SHARED != 0x00002000);
        BUILD_BUG_ON(FIEMAP_EXTENT_NO_DIRECT != 0x40000000);
        BUILD_BUG_ON(FIEMAP_EXTENT_NET != 0x80000000);
 
@@ -4955,6 +5012,9 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct hsm_state_set, hss_clearmask));
        LASSERTF((int)sizeof(((struct hsm_state_set *)0)->hss_clearmask) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct hsm_state_set *)0)->hss_clearmask));
+       BUILD_BUG_ON(HSS_SETMASK != 1);
+       BUILD_BUG_ON(HSS_CLEARMASK != 2);
+       BUILD_BUG_ON(HSS_ARCHIVE_ID != 4);
 
        /* Checks for struct hsm_current_action */
        LASSERTF((int)sizeof(struct hsm_current_action) == 24, "found %lld\n",
@@ -4971,6 +5031,16 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct hsm_current_action, hca_location));
        LASSERTF((int)sizeof(((struct hsm_current_action *)0)->hca_location) == 16, "found %lld\n",
                 (long long)(int)sizeof(((struct hsm_current_action *)0)->hca_location));
+       BUILD_BUG_ON(HPS_NONE != 0);
+       BUILD_BUG_ON(HPS_WAITING != 1);
+       BUILD_BUG_ON(HPS_RUNNING != 2);
+       BUILD_BUG_ON(HPS_DONE != 3);
+       BUILD_BUG_ON(HUA_NONE != 1);
+       BUILD_BUG_ON(HUA_ARCHIVE != 10);
+       BUILD_BUG_ON(HUA_RESTORE != 11);
+       BUILD_BUG_ON(HUA_RELEASE != 12);
+       BUILD_BUG_ON(HUA_REMOVE != 13);
+       BUILD_BUG_ON(HUA_CANCEL != 14);
 
        /* Checks for struct hsm_request */
        LASSERTF((int)sizeof(struct hsm_request) == 24, "found %lld\n",
@@ -5107,6 +5177,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct object_update, ou_params));
        LASSERTF((int)sizeof(((struct object_update *)0)->ou_params) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct object_update *)0)->ou_params));
+       BUILD_BUG_ON(UPDATE_FL_OST != 0x00000001);
+       BUILD_BUG_ON(UPDATE_FL_SYNC != 0x00000002);
+       BUILD_BUG_ON(UPDATE_FL_COMMITTED != 0x00000004);
+       BUILD_BUG_ON(UPDATE_FL_NOLOG != 0x00000008);
 
        /* Checks for struct object_update_request */
        LASSERTF((int)sizeof(struct object_update_request) == 8, "found %lld\n",
@@ -5127,6 +5201,7 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct object_update_request, ourq_updates));
        LASSERTF((int)sizeof(((struct object_update_request *)0)->ourq_updates) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct object_update_request *)0)->ourq_updates));
+       BUILD_BUG_ON(UPDATE_REQUEST_MAGIC != 0xBDDE0002);
 
        /* Checks for struct object_update_result */
        LASSERTF((int)sizeof(struct object_update_result) == 8, "found %lld\n",
@@ -5167,6 +5242,7 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct object_update_reply, ourp_lens));
        LASSERTF((int)sizeof(((struct object_update_reply *)0)->ourp_lens) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct object_update_reply *)0)->ourp_lens));
+       BUILD_BUG_ON(UPDATE_REPLY_MAGIC != 0x00BD0002);
 
        /* Checks for struct out_update_header */
        LASSERTF((int)sizeof(struct out_update_header) == 16, "found %lld\n",
@@ -5191,6 +5267,8 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct out_update_header, ouh_inline_data));
        LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_inline_data) == 0, "found %lld\n",
                 (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_data));
+       BUILD_BUG_ON(OUT_UPDATE_HEADER_MAGIC != 0xBDDF0001);
+       BUILD_BUG_ON(OUT_UPDATE_MAX_INLINE_SIZE != 4096);
 
        /* Checks for struct out_update_buffer */
        LASSERTF((int)sizeof(struct out_update_buffer) == 8, "found %lld\n",
@@ -5207,10 +5285,11 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct nodemap_cluster_rec */
        LASSERTF((int)sizeof(struct nodemap_cluster_rec) == 32, "found %lld\n",
                 (long long)(int)sizeof(struct nodemap_cluster_rec));
-       LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_name) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_name));
-       LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_name) == 17, "found %lld\n",
-                (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_name));
+       BUILD_BUG_ON(LUSTRE_NODEMAP_NAME_LENGTH != 16);
+       LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_name[16 + 1]) == 17, "found %lld\n",
+                (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]));
        LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_flags) == 17, "found %lld\n",
                 (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_flags));
        LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_flags) == 1, "found %lld\n",
@@ -5453,7 +5532,7 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)sizeof(((struct update_params *)0)->up_params));
 
        /* Checks for struct update_op */
-       LASSERTF((int)sizeof(struct update_op) == 24, "found %lld\n",
+       LASSERTF((int)sizeof(struct update_op) == 20, "found %lld\n",
                 (long long)(int)sizeof(struct update_op));
        LASSERTF((int)offsetof(struct update_op, uop_fid) == 0, "found %lld\n",
                 (long long)(int)offsetof(struct update_op, uop_fid));