Whamcloud - gitweb
LU-1842 ldlm: add support for quota LVB
authorJohann Lombardi <johann@whamcloud.com>
Wed, 26 Sep 2012 21:28:21 +0000 (23:28 +0200)
committerOleg Drokin <green@whamcloud.com>
Fri, 28 Sep 2012 05:01:45 +0000 (01:01 -0400)
This patch defines new LVB types for quota.
A new request buffer is also added to glimpse AST to allow the server
to pass additional information about the callback to the client.
This additional buffer will only be used in conjunction with quota
locks for the time being.

Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Change-Id: If5842bfff79d24e7d11ef33c47edb96fe6f11e76
Reviewed-on: http://review.whamcloud.com/4107
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
14 files changed:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_dlm.h
lustre/include/lustre_req_layout.h
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/mdt/mdt_handler.c
lustre/ofd/ofd_dlm.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/utils/req-layout.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index a41e82a..f4c6784 100644 (file)
@@ -1843,7 +1843,7 @@ struct quota_body {
  * lock (IT_QUOTA_CONN) reply, qb_fid contains slave index file FID. */
 #define qb_slv_fid       qb_fid
 /* qb_usage is the current qunit (in kbytes/inodes) when quota_body is used in
- * acquire reply */
+ * quota reply */
 #define qb_qunit         qb_usage
 
 extern void lustre_swab_quota_body(struct quota_body *b);
@@ -2456,15 +2456,52 @@ typedef union {
 
 extern void lustre_swab_ldlm_policy_data (ldlm_wire_policy_data_t *d);
 
+/* Data structures associated with the quota locks */
+
+/* Glimpse descriptor used for the index & per-ID quota locks */
+struct ldlm_gl_lquota_desc {
+       union lquota_id gl_id;    /* quota ID subject to the glimpse */
+       __u64           gl_flags; /* see LQUOTA_FL* below */
+       __u64           gl_ver;   /* new index version */
+       __u64           gl_hardlimit; /* new hardlimit or qunit value */
+       __u64           gl_softlimit; /* new softlimit */
+       __u64           gl_pad1;
+       __u64           gl_pad2;
+};
+#define gl_qunit       gl_hardlimit /* current qunit value used when
+                                     * glimpsing per-ID quota locks */
+
+/* quota glimpse flags */
+#define LQUOTA_FL_EDQUOT 0x1 /* user/group out of quota space on QMT */
+
+/* LVB used with quota (global and per-ID) locks */
+struct lquota_lvb {
+       __u64   lvb_flags;      /* see LQUOTA_FL* above */
+       __u64   lvb_id_may_rel; /* space that might be released later */
+       __u64   lvb_id_rel;     /* space released by the slave for this ID */
+       __u64   lvb_id_qunit;   /* current qunit value */
+       __u64   lvb_pad1;
+};
+
+/* LVB used with global quota lock */
+#define lvb_glb_ver  lvb_id_may_rel /* current version of the global index */
+
 /* Similarly to ldlm_wire_policy_data_t, there is one common swabber for all
  * LVB types. As a result, any new LVB structure must match the fields of the
  * ost_lvb structure. */
 union ldlm_wire_lvb {
-        struct ost_lvb l_ost;
+       struct ost_lvb          l_ost;
+       struct lquota_lvb       l_lquota;
 };
 
 extern void lustre_swab_lvb(union ldlm_wire_lvb *);
 
+union ldlm_gl_desc {
+       struct ldlm_gl_lquota_desc      lquota_desc;
+};
+
+extern void lustre_swab_gl_desc(union ldlm_gl_desc *);
+
 struct ldlm_intent {
         __u64 opc;
 };
index 27c7fc2..8b0a593 100644 (file)
@@ -576,6 +576,8 @@ struct ldlm_glimpse_work {
        struct ldlm_lock        *gl_lock; /* lock to glimpse */
        cfs_list_t               gl_list; /* linkage to other gl work structs */
        __u32                    gl_flags;/* see LDLM_GL_WORK_* below */
+       union ldlm_gl_desc      *gl_desc; /* glimpse descriptor to be packed in
+                                          * glimpse callback request */
 };
 
 /* the ldlm_glimpse_work is allocated on the stack and should not be freed */
index 6a7e265..01f1e12 100644 (file)
@@ -219,6 +219,7 @@ extern struct req_format RQF_LDLM_CALLBACK;
 extern struct req_format RQF_LDLM_CP_CALLBACK;
 extern struct req_format RQF_LDLM_BL_CALLBACK;
 extern struct req_format RQF_LDLM_GL_CALLBACK;
+extern struct req_format RQF_LDLM_GL_DESC_CALLBACK;
 /* LOG req_format */
 extern struct req_format RQF_LOG_CANCEL;
 extern struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE;
@@ -252,6 +253,7 @@ extern struct req_msg_field RMF_CONNECT_DATA;
 extern struct req_msg_field RMF_DLM_REQ;
 extern struct req_msg_field RMF_DLM_REP;
 extern struct req_msg_field RMF_DLM_LVB;
+extern struct req_msg_field RMF_DLM_GL_DESC;
 extern struct req_msg_field RMF_LDLM_INTENT;
 extern struct req_msg_field RMF_MDT_MD;
 extern struct req_msg_field RMF_REC_REINT;
index 65c1331..c6265f7 100644 (file)
@@ -99,6 +99,7 @@ struct ldlm_cb_set_arg {
        int                              type; /* LDLM_{CP,BL,GL}_CALLBACK */
        cfs_atomic_t                     restart;
        cfs_list_t                      *list;
+       union ldlm_gl_desc              *gl_desc; /* glimpse AST descriptor */
 };
 
 typedef enum {
index 665b3fc..e25e85a 100644 (file)
@@ -1637,6 +1637,11 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq)
        cfs_list_del_init(&gl_work->gl_list);
 
        lock = gl_work->gl_lock;
+
+       /* transfer the glimpse descriptor to ldlm_cb_set_arg */
+       arg->gl_desc = gl_work->gl_desc;
+
+       /* invoke the actual glimpse callback */
        if (lock->l_glimpse_ast(lock, (void*)arg) == 0)
                rc = 1;
 
index a9fa177..d5e4323 100644 (file)
@@ -1012,17 +1012,31 @@ int ldlm_server_glimpse_ast(struct ldlm_lock *lock, void *data)
        struct ptlrpc_request           *req;
        struct ldlm_cb_async_args       *ca;
        int                              rc;
+       struct req_format               *req_fmt;
         ENTRY;
 
         LASSERT(lock != NULL);
 
+       if (arg->gl_desc != NULL)
+               /* There is a glimpse descriptor to pack */
+               req_fmt = &RQF_LDLM_GL_DESC_CALLBACK;
+       else
+               req_fmt = &RQF_LDLM_GL_CALLBACK;
+
         req = ptlrpc_request_alloc_pack(lock->l_export->exp_imp_reverse,
-                                        &RQF_LDLM_GL_CALLBACK,
-                                        LUSTRE_DLM_VERSION, LDLM_GL_CALLBACK);
+                                       req_fmt, LUSTRE_DLM_VERSION,
+                                       LDLM_GL_CALLBACK);
 
         if (req == NULL)
                 RETURN(-ENOMEM);
 
+       if (arg->gl_desc != NULL) {
+               /* copy the GL descriptor */
+               union ldlm_gl_desc      *desc;
+               desc = req_capsule_client_get(&req->rq_pill, &RMF_DLM_GL_DESC);
+               *desc = *arg->gl_desc;
+       }
+
         body = req_capsule_client_get(&req->rq_pill, &RMF_DLM_REQ);
         body->lock_handle[0] = lock->l_remote_handle;
         ldlm_lock2desc(lock, &body->lock_desc);
index 3b590f0..c523462 100644 (file)
@@ -2361,9 +2361,9 @@ static int mdt_llog_prev_block(struct mdt_thread_info *info)
  * DLM handlers.
  */
 static struct ldlm_callback_suite cbs = {
-        .lcs_completion = ldlm_server_completion_ast,
-        .lcs_blocking   = ldlm_server_blocking_ast,
-        .lcs_glimpse    = NULL
+       .lcs_completion = ldlm_server_completion_ast,
+       .lcs_blocking   = ldlm_server_blocking_ast,
+       .lcs_glimpse    = ldlm_server_glimpse_ast
 };
 
 static int mdt_enqueue(struct mdt_thread_info *info)
index 22effa0..1f67141 100644 (file)
@@ -234,6 +234,9 @@ int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp,
        /* The glimpse callback is sent to one single extent lock. As a result,
         * the gl_work list is just composed of one element */
        cfs_list_add_tail(&gl_work.gl_list, &gl_list);
+       /* There is actually no need for a glimpse descriptor when glimpsing
+        * extent locks */
+       gl_work.gl_desc = NULL;
        /* the ldlm_glimpse_work structure is allocated on the stack */
        gl_work.gl_flags = LDLM_GL_WORK_NOFREE;
 
index 0d0e106..02e434a 100644 (file)
@@ -360,6 +360,12 @@ static const struct req_msg_field *ldlm_cp_callback_client[] = {
         &RMF_DLM_LVB
 };
 
+static const struct req_msg_field *ldlm_gl_callback_desc_client[] = {
+       &RMF_PTLRPC_BODY,
+       &RMF_DLM_REQ,
+       &RMF_DLM_GL_DESC
+};
+
 static const struct req_msg_field *ldlm_gl_callback_server[] = {
         &RMF_PTLRPC_BODY,
         &RMF_DLM_LVB
@@ -638,6 +644,7 @@ static struct req_format *req_formats[] = {
         &RQF_LDLM_CP_CALLBACK,
         &RQF_LDLM_BL_CALLBACK,
         &RQF_LDLM_GL_CALLBACK,
+       &RQF_LDLM_GL_DESC_CALLBACK,
         &RQF_LDLM_INTENT,
         &RQF_LDLM_INTENT_GETATTR,
         &RQF_LDLM_INTENT_OPEN,
@@ -904,6 +911,11 @@ struct req_msg_field RMF_DLM_LVB =
         NULL);
 EXPORT_SYMBOL(RMF_DLM_LVB);
 
+struct req_msg_field RMF_DLM_GL_DESC =
+       DEFINE_MSGF("dlm_gl_desc", 0, sizeof(union ldlm_gl_desc),
+                   lustre_swab_gl_desc, NULL);
+EXPORT_SYMBOL(RMF_DLM_GL_DESC);
+
 struct req_msg_field RMF_MDT_MD =
         DEFINE_MSGF("mdt_md", RMF_F_NO_SIZE_CHECK, MIN_MD_SIZE, NULL, NULL);
 EXPORT_SYMBOL(RMF_MDT_MD);
@@ -1226,6 +1238,11 @@ struct req_format RQF_LDLM_GL_CALLBACK =
                         ldlm_gl_callback_server);
 EXPORT_SYMBOL(RQF_LDLM_GL_CALLBACK);
 
+struct req_format RQF_LDLM_GL_DESC_CALLBACK =
+       DEFINE_REQ_FMT0("LDLM_GL_CALLBACK", ldlm_gl_callback_desc_client,
+                       ldlm_gl_callback_server);
+EXPORT_SYMBOL(RQF_LDLM_GL_DESC_CALLBACK);
+
 struct req_format RQF_LDLM_INTENT =
         DEFINE_REQ_FMT0("LDLM_INTENT",
                         ldlm_intent_client, ldlm_intent_server);
index dd46499..87d38ac 100644 (file)
@@ -1822,6 +1822,17 @@ void lustre_swab_generic_32s(__u32 *val)
 }
 EXPORT_SYMBOL(lustre_swab_generic_32s);
 
+void lustre_swab_gl_desc(union ldlm_gl_desc *desc)
+{
+       lustre_swab_lu_fid(&desc->lquota_desc.gl_id.qid_fid);
+       __swab64s(&desc->lquota_desc.gl_flags);
+       __swab64s(&desc->lquota_desc.gl_ver);
+       __swab64s(&desc->lquota_desc.gl_hardlimit);
+       __swab64s(&desc->lquota_desc.gl_softlimit);
+       CLASSERT(offsetof(typeof(desc->lquota_desc), gl_pad1) != 0);
+       CLASSERT(offsetof(typeof(desc->lquota_desc), gl_pad2) != 0);
+}
+
 void lustre_swab_lvb(union ldlm_wire_lvb *lvb)
 {
         /* The ldlm_wire_lvb union represents all the possible LVB types.
index 667b83a..b0fe417 100644 (file)
@@ -3079,6 +3079,64 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_blocks) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_blocks));
 
+        /* Checks for struct lquota_lvb */
+        LASSERTF((int)sizeof(struct lquota_lvb) == 40, "found %lld\n",
+                 (long long)(int)sizeof(struct lquota_lvb));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_flags) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_flags));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_flags) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_flags));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_may_rel) == 8, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_id_may_rel));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_may_rel) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_may_rel));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_rel) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_id_rel));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel));
+        LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n",
+                 (long long)LQUOTA_FL_EDQUOT);
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_pad1) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_pad1));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1));
+
+        /* Checks for struct ldlm_gl_lquota_desc */
+        LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n",
+                 (long long)(int)sizeof(struct ldlm_gl_lquota_desc));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_id) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_id));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_id) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_id));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_flags) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_flags));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_flags) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_flags));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_ver) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_ver));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_ver) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_ver));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_hardlimit) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_hardlimit));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_hardlimit) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_hardlimit));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_softlimit) == 40, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_softlimit));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_softlimit) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_softlimit));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_pad1) == 48, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_pad1));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad1) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad1));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_pad2) == 56, "found %lld\n",
+                 (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));
+
         /* 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));
index 2c1264d..a0196c4 100644 (file)
@@ -78,6 +78,7 @@
 #define lustre_swab_qdata NULL
 #define lustre_swab_quota_body NULL
 #define lustre_swab_lvb NULL
+#define lustre_swab_gl_desc NULL
 #define lustre_swab_mgs_config_body NULL
 #define lustre_swab_mgs_config_res NULL
 #define dump_rniobuf NULL
index 2910754..111cfbc 100644 (file)
@@ -1302,7 +1302,7 @@ check_ldlm_reply(void)
 }
 
 static void
-check_ldlm_lvb(void)
+check_ldlm_ost_lvb(void)
 {
         BLANK_LINE();
         CHECK_STRUCT(ost_lvb);
@@ -1314,6 +1314,34 @@ check_ldlm_lvb(void)
 }
 
 static void
+check_ldlm_lquota_lvb(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(lquota_lvb);
+       CHECK_MEMBER(lquota_lvb, lvb_flags);
+       CHECK_MEMBER(lquota_lvb, lvb_id_may_rel);
+       CHECK_MEMBER(lquota_lvb, lvb_id_rel);
+       CHECK_MEMBER(lquota_lvb, lvb_id_qunit);
+       CHECK_MEMBER(lquota_lvb, lvb_pad1);
+       CHECK_VALUE(LQUOTA_FL_EDQUOT);
+}
+
+static void
+check_ldlm_gl_lquota_desc(void)
+{
+       BLANK_LINE();
+       CHECK_STRUCT(ldlm_gl_lquota_desc);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_id);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_flags);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_ver);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_hardlimit);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_softlimit);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_pad1);
+       CHECK_MEMBER(ldlm_gl_lquota_desc, gl_pad2);
+}
+
+
+static void
 check_mgs_send_param(void)
 {
         BLANK_LINE();
@@ -2146,7 +2174,9 @@ main(int argc, char **argv)
         check_ldlm_lock_desc();
         check_ldlm_request();
         check_ldlm_reply();
-        check_ldlm_lvb();
+        check_ldlm_ost_lvb();
+        check_ldlm_lquota_lvb();
+        check_ldlm_gl_lquota_desc();
         check_mgs_send_param();
         check_cfg_marker();
         check_llog_logid();
index f5fd813..b724534 100644 (file)
@@ -3087,6 +3087,64 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_blocks) == 8, "found %lld\n",
                  (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_blocks));
 
+        /* Checks for struct lquota_lvb */
+        LASSERTF((int)sizeof(struct lquota_lvb) == 40, "found %lld\n",
+                 (long long)(int)sizeof(struct lquota_lvb));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_flags) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_flags));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_flags) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_flags));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_may_rel) == 8, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_id_may_rel));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_may_rel) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_may_rel));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_rel) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_id_rel));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel));
+        LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n",
+                 (long long)LQUOTA_FL_EDQUOT);
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit));
+        LASSERTF((int)offsetof(struct lquota_lvb, lvb_pad1) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct lquota_lvb, lvb_pad1));
+        LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1));
+
+        /* Checks for struct ldlm_gl_lquota_desc */
+        LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n",
+                 (long long)(int)sizeof(struct ldlm_gl_lquota_desc));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_id) == 0, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_id));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_id) == 16, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_id));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_flags) == 16, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_flags));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_flags) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_flags));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_ver) == 24, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_ver));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_ver) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_ver));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_hardlimit) == 32, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_hardlimit));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_hardlimit) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_hardlimit));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_softlimit) == 40, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_softlimit));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_softlimit) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_softlimit));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_pad1) == 48, "found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_gl_lquota_desc, gl_pad1));
+        LASSERTF((int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad1) == 8, "found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_gl_lquota_desc *)0)->gl_pad1));
+        LASSERTF((int)offsetof(struct ldlm_gl_lquota_desc, gl_pad2) == 56, "found %lld\n",
+                 (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));
+
         /* 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));