struct object_update ourq_updates[0];
};
-#define OUT_UPDATE_HEADER_MAGIC 0xBDDF0001
+#define OUT_UPDATE_HEADER_MAGIC 0xBDDF0001
+#define OUT_UPDATE_MAX_INLINE_SIZE 4096
/* Header for updates request between MDTs */
struct out_update_header {
__u32 ouh_magic;
__u32 ouh_count;
+ __u32 ouh_inline_length;
+ __u32 ouh_padding;
+ __u32 ouh_inline_data[0];
};
struct out_update_buffer {
}
/**
+ * Prepare inline update request
+ *
+ * Prepare OUT update ptlrpc inline request, and the request usually includes
+ * one update buffer, which does not need bulk transfer.
+ *
+ * \param[in] env execution environment
+ * \param[in] req ptlrpc request
+ * \param[in] ours sub osp_update_request to be packed
+ *
+ * \retval 0 if packing succeeds
+ * \retval negative errno if packing fails
+ */
+int osp_prep_inline_update_req(const struct lu_env *env,
+ struct ptlrpc_request *req,
+ struct osp_update_request_sub *ours)
+{
+ struct out_update_header *ouh;
+ __u32 update_req_size = object_update_request_size(ours->ours_req);
+ int rc;
+
+ req_capsule_set_size(&req->rq_pill, &RMF_OUT_UPDATE_HEADER, RCL_CLIENT,
+ update_req_size + sizeof(*ouh));
+
+ rc = ptlrpc_request_pack(req, LUSTRE_MDS_VERSION, OUT_UPDATE);
+ if (rc != 0)
+ RETURN(rc);
+
+ ouh = req_capsule_client_get(&req->rq_pill, &RMF_OUT_UPDATE_HEADER);
+ ouh->ouh_magic = OUT_UPDATE_HEADER_MAGIC;
+ ouh->ouh_count = 1;
+ ouh->ouh_inline_length = update_req_size;
+
+ memcpy(ouh->ouh_inline_data, ours->ours_req, update_req_size);
+
+ req_capsule_set_size(&req->rq_pill, &RMF_OUT_UPDATE_REPLY,
+ RCL_SERVER, OUT_UPDATE_REPLY_SIZE);
+
+ ptlrpc_request_set_replen(req);
+ req->rq_request_portal = OUT_PORTAL;
+ req->rq_reply_portal = OSC_REPLY_PORTAL;
+
+ RETURN(rc);
+}
+
+/**
* Prepare update request.
*
* Prepare OUT update ptlrpc request, and the request usually includes
object_update_request_dump(ours->ours_req, D_INFO);
buf_count++;
}
+ LASSERT(buf_count > 0);
req = ptlrpc_request_alloc(imp, &RQF_OUT_UPDATE);
if (req == NULL)
RETURN(-ENOMEM);
+ if (buf_count == 1) {
+ ours = list_entry(our->our_req_list.next,
+ struct osp_update_request_sub, ours_list);
+
+ /* Let's check if it can be packed inline */
+ if (object_update_request_size(ours->ours_req) +
+ sizeof(struct out_update_header) <
+ OUT_UPDATE_MAX_INLINE_SIZE) {
+ rc = osp_prep_inline_update_req(env, req, ours);
+ if (rc == 0)
+ *reqp = req;
+ GOTO(out_req, rc);
+ }
+ }
+
+ req_capsule_set_size(&req->rq_pill, &RMF_OUT_UPDATE_HEADER, RCL_CLIENT,
+ sizeof(struct osp_update_request));
+
req_capsule_set_size(&req->rq_pill, &RMF_OUT_UPDATE_BUF, RCL_CLIENT,
buf_count * sizeof(*oub));
ouh = req_capsule_client_get(&req->rq_pill, &RMF_OUT_UPDATE_HEADER);
ouh->ouh_magic = OUT_UPDATE_HEADER_MAGIC;
ouh->ouh_count = buf_count;
-
+ ouh->ouh_inline_length = 0;
oub = req_capsule_client_get(&req->rq_pill, &RMF_OUT_UPDATE_BUF);
list_for_each_entry(ours, &our->our_req_list, ours_list) {
oub->oub_size = ours->ours_req_size;
* \retval 0 if RPC succeeds.
* \retval negative errno if RPC fails.
*/
-
int osp_remote_sync(const struct lu_env *env, struct osp_device *osp,
struct osp_update_request *our,
struct ptlrpc_request **reqp)
lustre_swab_lfsck_reply, NULL);
EXPORT_SYMBOL(RMF_LFSCK_REPLY);
-struct req_msg_field RMF_OUT_UPDATE_HEADER = DEFINE_MSGF("out_update", 0,
- sizeof(struct out_update_header),
- lustre_swab_out_update_header, NULL);
+struct req_msg_field RMF_OUT_UPDATE_HEADER = DEFINE_MSGF("out_update_header", 0,
+ -1, lustre_swab_out_update_header, NULL);
EXPORT_SYMBOL(RMF_OUT_UPDATE_HEADER);
struct req_msg_field RMF_OUT_UPDATE_BUF = DEFINE_MSGF("update_buf",
{
__swab32s(&ouh->ouh_magic);
__swab32s(&ouh->ouh_count);
+ __swab32s(&ouh->ouh_inline_length);
+ __swab32s(&ouh->ouh_padding);
}
EXPORT_SYMBOL(lustre_swab_out_update_header);
OBD_CONNECT_MULTIMODRPCS);
LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_DIR_STRIPE);
+ LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_BULK_MBITS);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
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));
+ /* Checks for struct out_update_header */
+ LASSERTF((int)sizeof(struct out_update_header) == 16, "found %lld\n",
+ (long long)(int)sizeof(struct out_update_header));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_magic) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_magic));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_magic) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_magic));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_count) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_count));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_count));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_inline_length) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_inline_length));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_inline_length) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_length));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_padding) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_padding));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_padding) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_padding));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_inline_data) == 16, "found %lld\n",
+ (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));
+
+ /* Checks for struct out_update_buffer */
+ LASSERTF((int)sizeof(struct out_update_buffer) == 8, "found %lld\n",
+ (long long)(int)sizeof(struct out_update_buffer));
+ LASSERTF((int)offsetof(struct out_update_buffer, oub_size) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_buffer, oub_size));
+ LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_size) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_size));
+ LASSERTF((int)offsetof(struct out_update_buffer, oub_padding) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_buffer, oub_padding));
+ LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_padding) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_padding));
+
/* Checks for struct lfsck_request */
LASSERTF((int)sizeof(struct lfsck_request) == 96, "found %lld\n",
(long long)(int)sizeof(struct lfsck_request));
(long long)(int)offsetof(struct lfsck_reply, lr_padding_2));
LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
+
+ /* Checks for struct update_params */
+ LASSERTF((int)sizeof(struct update_params) == 0, "found %lld\n",
+ (long long)(int)sizeof(struct update_params));
+ LASSERTF((int)offsetof(struct update_params, up_params) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_params, up_params));
+ LASSERTF((int)sizeof(((struct update_params *)0)->up_params) == 0, "found %lld\n",
+ (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",
+ (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));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_fid) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_fid));
+ LASSERTF((int)offsetof(struct update_op, uop_type) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_type));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_type) == 2, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_type));
+ LASSERTF((int)offsetof(struct update_op, uop_param_count) == 18, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_param_count));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_param_count) == 2, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
+ LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_params_off));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_params_off) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_params_off));
+
+ /* Checks for struct update_ops */
+ LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
+ (long long)(int)sizeof(struct update_ops));
+ LASSERTF((int)offsetof(struct update_ops, uops_op) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_ops, uops_op));
+ LASSERTF((int)sizeof(((struct update_ops *)0)->uops_op) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_ops *)0)->uops_op));
+
+ /* Checks for struct update_records */
+ LASSERTF((int)sizeof(struct update_records) == 32, "found %lld\n",
+ (long long)(int)sizeof(struct update_records));
+ LASSERTF((int)offsetof(struct update_records, ur_master_transno) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_master_transno));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_master_transno) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_master_transno));
+ LASSERTF((int)offsetof(struct update_records, ur_batchid) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_batchid));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_batchid) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_batchid));
+ LASSERTF((int)offsetof(struct update_records, ur_flags) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_flags));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_flags));
+ LASSERTF((int)offsetof(struct update_records, ur_index) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_index));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_index) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_index));
+ LASSERTF((int)offsetof(struct update_records, ur_update_count) == 24, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_update_count));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_update_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_update_count));
+ LASSERTF((int)offsetof(struct update_records, ur_param_count) == 28, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_param_count));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_param_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_param_count));
+ LASSERTF(UPDATE_RECORD_CONTINUE == 0x00000001UL, "found 0x%.8xUL\n",
+ (unsigned)UPDATE_RECORD_CONTINUE);
+
+ /* Checks for struct llog_update_record */
+ LASSERTF((int)sizeof(struct llog_update_record) == 48, "found %lld\n",
+ (long long)(int)sizeof(struct llog_update_record));
+ LASSERTF((int)offsetof(struct llog_update_record, lur_hdr) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct llog_update_record, lur_hdr));
+ LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_hdr) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_update_record *)0)->lur_hdr));
+ LASSERTF((int)offsetof(struct llog_update_record, lur_update_rec) == 16, "found %lld\n",
+ (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));
}
struct req_capsule *pill = tsi->tsi_pill;
struct dt_device *dt = tsi->tsi_tgt->lut_bottom;
struct out_update_header *ouh;
- struct out_update_buffer *oub;
+ struct out_update_buffer *oub = NULL;
struct object_update *update;
struct object_update_reply *reply;
- struct ptlrpc_bulk_desc *desc;
+ struct ptlrpc_bulk_desc *desc = NULL;
struct l_wait_info lwi;
void **update_bufs;
int current_batchid = -1;
unsigned int reply_index = 0;
int rc = 0;
int rc1 = 0;
-
+ int ouh_size;
ENTRY;
req_capsule_set(pill, &RQF_OUT_UPDATE);
+ ouh_size = req_capsule_get_size(pill, &RMF_OUT_UPDATE_HEADER,
+ RCL_CLIENT);
+ if (ouh_size <= 0)
+ RETURN(err_serious(-EPROTO));
+
ouh = req_capsule_client_get(pill, &RMF_OUT_UPDATE_HEADER);
- if (ouh == NULL) {
- CERROR("%s: No buf!: rc = %d\n", tgt_name(tsi->tsi_tgt),
- -EPROTO);
+ if (ouh == NULL)
RETURN(err_serious(-EPROTO));
- }
if (ouh->ouh_magic != OUT_UPDATE_HEADER_MAGIC) {
CERROR("%s: invalid update buffer magic %x expect %x: "
}
update_buf_count = ouh->ouh_count;
- if (update_buf_count == 0) {
- CERROR("%s: empty update: rc = %d\n", tgt_name(tsi->tsi_tgt),
- -EPROTO);
+ if (update_buf_count == 0)
RETURN(err_serious(-EPROTO));
- }
req_capsule_set_size(pill, &RMF_OUT_UPDATE_REPLY, RCL_SERVER,
OUT_UPDATE_REPLY_SIZE);
if (update_bufs == NULL)
RETURN(-ENOMEM);
- oub = req_capsule_client_get(pill, &RMF_OUT_UPDATE_BUF);
- desc = ptlrpc_prep_bulk_exp(pill->rc_req, update_buf_count,
- PTLRPC_BULK_OPS_COUNT,
- PTLRPC_BULK_GET_SINK |
- PTLRPC_BULK_BUF_KVEC,
- MDS_BULK_PORTAL, &ptlrpc_bulk_kvec_ops);
- if (desc == NULL)
- GOTO(out_free, rc = -ENOMEM);
-
- /* NB Having prepped, we must commit... */
- for (i = 0; i < update_buf_count; i++, oub++) {
- OBD_ALLOC(update_bufs[i], oub->oub_size);
- if (update_bufs[i] == NULL)
+ if (ouh->ouh_inline_length > 0) {
+ update_bufs[0] = ouh->ouh_inline_data;
+ } else {
+ struct out_update_buffer *tmp;
+
+ oub = req_capsule_client_get(pill, &RMF_OUT_UPDATE_BUF);
+ if (oub == NULL)
+ GOTO(out_free, rc = -EPROTO);
+
+ desc = ptlrpc_prep_bulk_exp(pill->rc_req, update_buf_count,
+ PTLRPC_BULK_OPS_COUNT,
+ PTLRPC_BULK_GET_SINK |
+ PTLRPC_BULK_BUF_KVEC,
+ MDS_BULK_PORTAL,
+ &ptlrpc_bulk_kvec_ops);
+ if (desc == NULL)
GOTO(out_free, rc = -ENOMEM);
- desc->bd_frag_ops->add_iov_frag(desc, update_bufs[i],
- oub->oub_size);
- }
+ tmp = oub;
+ for (i = 0; i < update_buf_count; i++, tmp++) {
+ if (tmp->oub_size >= OUT_MAXREQSIZE)
+ GOTO(out_free, rc = -EPROTO);
- pill->rc_req->rq_bulk_write = 1;
- rc = sptlrpc_svc_prep_bulk(pill->rc_req, desc);
- if (rc != 0)
- GOTO(out_free, rc);
+ OBD_ALLOC(update_bufs[i], tmp->oub_size);
+ if (update_bufs[i] == NULL)
+ GOTO(out_free, rc = -ENOMEM);
- rc = target_bulk_io(pill->rc_req->rq_export, desc, &lwi);
- if (rc < 0)
- GOTO(out_free, rc);
+ desc->bd_frag_ops->add_iov_frag(desc, update_bufs[i],
+ tmp->oub_size);
+ }
+ pill->rc_req->rq_bulk_write = 1;
+ rc = sptlrpc_svc_prep_bulk(pill->rc_req, desc);
+ if (rc != 0)
+ GOTO(out_free, rc);
+
+ rc = target_bulk_io(pill->rc_req->rq_export, desc, &lwi);
+ if (rc < 0)
+ GOTO(out_free, rc);
+ }
/* Prepare the update reply buffer */
reply = req_capsule_server_get(pill, &RMF_OUT_UPDATE_REPLY);
if (reply == NULL)
}
out_free:
- oub = req_capsule_client_get(pill, &RMF_OUT_UPDATE_BUF);
if (update_bufs != NULL) {
- for (i = 0; i < update_buf_count; i++, oub++) {
- if (update_bufs[i] != NULL)
- OBD_FREE(update_bufs[i], oub->oub_size);
+ if (oub != NULL) {
+ for (i = 0; i < update_buf_count; i++, oub++) {
+ if (update_bufs[i] != NULL)
+ OBD_FREE(update_bufs[i], oub->oub_size);
+ }
}
- OBD_FREE(update_bufs, sizeof(update_bufs[0]) *
- update_buf_count);
+
+ OBD_FREE(update_bufs, sizeof(*update_bufs) * update_buf_count);
}
if (desc != NULL)
CHECK_MEMBER(object_update_reply, ourp_lens);
}
+static void check_out_update_header(void)
+{
+ BLANK_LINE();
+ CHECK_STRUCT(out_update_header);
+ CHECK_MEMBER(out_update_header, ouh_magic);
+ CHECK_MEMBER(out_update_header, ouh_count);
+ CHECK_MEMBER(out_update_header, ouh_inline_length);
+ CHECK_MEMBER(out_update_header, ouh_padding);
+ CHECK_MEMBER(out_update_header, ouh_inline_data);
+}
+
+static void check_out_update_buffer(void)
+{
+ BLANK_LINE();
+ CHECK_STRUCT(out_update_buffer);
+ CHECK_MEMBER(out_update_buffer, oub_size);
+ CHECK_MEMBER(out_update_buffer, oub_padding);
+}
+
static void check_lfsck_request(void)
{
BLANK_LINE();
check_object_update_request();
check_object_update_result();
check_object_update_reply();
+ check_out_update_header();
+ check_out_update_buffer();
check_lfsck_request();
check_lfsck_reply();
(int)offsetof(struct ptlrpc_body_v3, pb_padding64_2), (int)offsetof(struct ptlrpc_body_v2, pb_padding64_2));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding64_2) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding64_2), "%d != %d\n",
(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding64_2), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding64_2));
-
LASSERTF(MSG_PTLRPC_BODY_OFF == 0, "found %lld\n",
(long long)MSG_PTLRPC_BODY_OFF);
LASSERTF(REQ_REC_OFF == 1, "found %lld\n",
OBD_CONNECT_MULTIMODRPCS);
LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_DIR_STRIPE);
+ LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_BULK_MBITS);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
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));
+ /* Checks for struct out_update_header */
+ LASSERTF((int)sizeof(struct out_update_header) == 16, "found %lld\n",
+ (long long)(int)sizeof(struct out_update_header));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_magic) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_magic));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_magic) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_magic));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_count) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_count));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_count));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_inline_length) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_inline_length));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_inline_length) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_length));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_padding) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_padding));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_padding) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_padding));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_inline_data) == 16, "found %lld\n",
+ (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));
+
+ /* Checks for struct out_update_buffer */
+ LASSERTF((int)sizeof(struct out_update_buffer) == 8, "found %lld\n",
+ (long long)(int)sizeof(struct out_update_buffer));
+ LASSERTF((int)offsetof(struct out_update_buffer, oub_size) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_buffer, oub_size));
+ LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_size) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_size));
+ LASSERTF((int)offsetof(struct out_update_buffer, oub_padding) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_buffer, oub_padding));
+ LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_padding) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_padding));
+
/* Checks for struct lfsck_request */
LASSERTF((int)sizeof(struct lfsck_request) == 96, "found %lld\n",
(long long)(int)sizeof(struct lfsck_request));
(long long)(int)offsetof(struct lfsck_reply, lr_padding_2));
LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
+
+ /* Checks for struct update_params */
+ LASSERTF((int)sizeof(struct update_params) == 0, "found %lld\n",
+ (long long)(int)sizeof(struct update_params));
+ LASSERTF((int)offsetof(struct update_params, up_params) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_params, up_params));
+ LASSERTF((int)sizeof(((struct update_params *)0)->up_params) == 0, "found %lld\n",
+ (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",
+ (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));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_fid) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_fid));
+ LASSERTF((int)offsetof(struct update_op, uop_type) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_type));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_type) == 2, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_type));
+ LASSERTF((int)offsetof(struct update_op, uop_param_count) == 18, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_param_count));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_param_count) == 2, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
+ LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_params_off));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_params_off) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_params_off));
+
+ /* Checks for struct update_ops */
+ LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
+ (long long)(int)sizeof(struct update_ops));
+ LASSERTF((int)offsetof(struct update_ops, uops_op) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_ops, uops_op));
+ LASSERTF((int)sizeof(((struct update_ops *)0)->uops_op) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_ops *)0)->uops_op));
+
+ /* Checks for struct update_records */
+ LASSERTF((int)sizeof(struct update_records) == 32, "found %lld\n",
+ (long long)(int)sizeof(struct update_records));
+ LASSERTF((int)offsetof(struct update_records, ur_master_transno) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_master_transno));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_master_transno) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_master_transno));
+ LASSERTF((int)offsetof(struct update_records, ur_batchid) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_batchid));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_batchid) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_batchid));
+ LASSERTF((int)offsetof(struct update_records, ur_flags) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_flags));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_flags));
+ LASSERTF((int)offsetof(struct update_records, ur_index) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_index));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_index) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_index));
+ LASSERTF((int)offsetof(struct update_records, ur_update_count) == 24, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_update_count));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_update_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_update_count));
+ LASSERTF((int)offsetof(struct update_records, ur_param_count) == 28, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_param_count));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_param_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_param_count));
+ LASSERTF(UPDATE_RECORD_CONTINUE == 0x00000001UL, "found 0x%.8xUL\n",
+ (unsigned)UPDATE_RECORD_CONTINUE);
+
+ /* Checks for struct llog_update_record */
+ LASSERTF((int)sizeof(struct llog_update_record) == 48, "found %lld\n",
+ (long long)(int)sizeof(struct llog_update_record));
+ LASSERTF((int)offsetof(struct llog_update_record, lur_hdr) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct llog_update_record, lur_hdr));
+ LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_hdr) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_update_record *)0)->lur_hdr));
+ LASSERTF((int)offsetof(struct llog_update_record, lur_update_rec) == 16, "found %lld\n",
+ (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));
}