st->st_committed, st->st_stopped, st->st_sub_th);
list_for_each_entry(stc, &st->st_cookie_list, stc_list) {
- CDEBUG(mask, " cookie "DOSTID": %u\n",
- POSTID(&stc->stc_cookie.lgc_lgl.lgl_oi),
+ CDEBUG(mask, " cookie "DFID".%u\n",
+ PFID(&stc->stc_cookie.lgc_lgl.lgl_oi.oi_fid),
stc->stc_cookie.lgc_index);
}
}
"lrh_len %u record_size %zu\n", record->lur_hdr.lrh_len,
llog_update_record_size(record));
- if (likely(record->lur_hdr.lrh_len <= ctxt->loc_chunk_size)) {
+ /*
+ * If its size > llog chunk_size, then write current chunk to the update
+ * llog, NB the padding should >= LLOG_MIN_REC_SIZE.
+ *
+ * So check padding length is either >= LLOG_MIN_REC_SIZE or is 0
+ * (record length just matches the chunk size).
+ */
+
+ reclen = record->lur_hdr.lrh_len;
+ if (reclen + LLOG_MIN_REC_SIZE <= ctxt->loc_chunk_size ||
+ reclen == ctxt->loc_chunk_size) {
OBD_ALLOC_PTR(stc);
if (stc == NULL)
GOTO(llog_put, rc = -ENOMEM);
rc = llog_add(env, ctxt->loc_handle, &record->lur_hdr,
&stc->stc_cookie, sub_th->st_sub_th);
- CDEBUG(D_INFO, "%s: Add update log "DOSTID":%u: rc = %d\n",
+ CDEBUG(D_INFO, "%s: Add update log "DFID".%u: rc = %d\n",
dt->dd_lu_dev.ld_obd->obd_name,
- POSTID(&stc->stc_cookie.lgc_lgl.lgl_oi),
+ PFID(&stc->stc_cookie.lgc_lgl.lgl_oi.oi_fid),
stc->stc_cookie.lgc_index, rc);
if (rc > 0) {
else
eof = true;
- /*
- * If its size > llog chunk_size, then write current chunk to
- * the update llog, NB the padding should >= LLOG_MIN_REC_SIZE.
- *
- * So check padding length is either >= LLOG_MIN_REC_SIZE or is
- * 0 (record length just matches the chunk size).
- */
reclen = __llog_update_record_size(
__update_records_size(next - start));
if ((reclen + LLOG_MIN_REC_SIZE <= ctxt->loc_chunk_size ||
rc = llog_add(env, ctxt->loc_handle, &lur->lur_hdr,
&stc->stc_cookie, sub_th->st_sub_th);
- CDEBUG(D_INFO, "%s: Add update log "DOSTID":%u rc = %d\n",
+ CDEBUG(D_INFO, "%s: Add update log "DFID".%u: rc = %d\n",
dt->dd_lu_dev.ld_obd->obd_name,
- POSTID(&stc->stc_cookie.lgc_lgl.lgl_oi),
+ PFID(&stc->stc_cookie.lgc_lgl.lgl_oi.oi_fid),
stc->stc_cookie.lgc_index, rc);
if (rc > 0) {
rc = llog_cat_cancel_records(env, ctxt->loc_handle, 1,
cookie);
CDEBUG(D_HA, "%s: batchid %llu cancel update log "
- DOSTID ".%u : rc = %d\n", obd->obd_name,
+ DFID".%u: rc = %d\n", obd->obd_name,
tmt->tmt_batchid,
- POSTID(&cookie->lgc_lgl.lgl_oi),
+ PFID(&cookie->lgc_lgl.lgl_oi.oi_fid),
cookie->lgc_index, rc);
}
th = dt_trans_create(env, tdtd->tdtd_lut->lut_bottom);
if (IS_ERR(th)) {
+ atomic_dec(&tdtd->tdtd_refcount);
OBD_FREE_PTR(dtbd);
RETURN(PTR_ERR(th));
}
stop:
dt_trans_stop(env, tdtd->tdtd_lut->lut_bottom, th);
- if (rc < 0)
+ if (rc < 0) {
+ atomic_dec(&tdtd->tdtd_refcount);
OBD_FREE_PTR(dtbd);
+ }
RETURN(rc);
}
if (rc != 0)
RETURN(rc);
- task = kthread_run(distribute_txn_commit_thread, tdtd, "tdtd-%u",
+ task = kthread_run(distribute_txn_commit_thread, tdtd, "dist_txn-%u",
index);
if (IS_ERR(task))
RETURN(PTR_ERR(task));